Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 0027b30

Browse files
committed
#479 Fixing toString in RestConfig
1 parent 69ba517 commit 0027b30

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/com/marklogic/rest/util/RestConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public DatabaseClientBuilder newDatabaseClientBuilder() {
125125

126126
@Override
127127
public String toString() {
128-
return String.format("%s://%shost:%d", getScheme(), getHost(), getPort());
128+
return String.format("%s://%s:%d", getScheme(), getHost(), getPort());
129129
}
130130

131131
/**

src/test/java/com/marklogic/rest/util/RestConfigTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,13 @@ void buildUriWithBasePath() {
7272
config.setBasePath("/secure");
7373
assertEquals("https://somehost:8002/secure/target/path", config.buildUri(targetPath).toString());
7474
}
75+
76+
@Test
77+
void verifyToString() {
78+
RestConfig config = new RestConfig("somewhere", 8008, "some", "user");
79+
assertEquals("http://somewhere:8008", config.toString());
80+
81+
config.setScheme("https");
82+
assertEquals("https://somewhere:8008", config.toString());
83+
}
7584
}

0 commit comments

Comments
 (0)