Skip to content

Commit

Permalink
Always append slash after Postgres db endpoint (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmarty authored Aug 25, 2023
1 parent 42dc301 commit d25e52d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ public String constructUrlFromEndpointPortDatabase(String endpoint, String port,
if (!StringUtils.isNullOrEmpty(port)) {
url += ":" + port;
}

url += "/";

if (!StringUtils.isNullOrEmpty(dbname)) {
url += "/" + dbname;
url += dbname;
}
return url;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void test_constructUrlNullPort() {
@Test
public void test_constructUrlNullDatabase() {
String url = sut.constructUrlFromEndpointPortDatabase("test-endpoint", "1234", null);
assertEquals(url, "jdbc:postgresql://test-endpoint:1234");
assertEquals(url, "jdbc:postgresql://test-endpoint:1234/");
}

@Test
Expand Down

0 comments on commit d25e52d

Please sign in to comment.