Skip to content

Commit

Permalink
Remove swagger url when starting the application
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalgrimaud committed Apr 16, 2022
1 parent 919cee9 commit 8924da4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/tech/jhipster/lite/JHLiteApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public static String accessUrlLocal(String protocol, String serverPort, String c
if (StringUtils.isBlank(serverPort)) {
return "";
}
return String.format(" Local: \t%s://localhost:%s%sswagger-ui.html", protocol, serverPort, contextPath) + LF;
return String.format(" Local: \t%s://localhost:%s%s", protocol, serverPort, contextPath) + LF;
}

public static String accessUrlExternal(String protocol, String hostAddress, String serverPort, String contextPath) {
if (StringUtils.isBlank(serverPort)) {
return "";
}
return String.format(" External: \t%s://%s:%s%sswagger-ui.html", protocol, hostAddress, serverPort, contextPath) + LF;
return String.format(" External: \t%s://%s:%s%s", protocol, hostAddress, serverPort, contextPath) + LF;
}

public static String profile(String profiles) {
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/tech/jhipster/lite/JHLiteAppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ void shouldAccessUrlLocalWithoutServerPort() {
@Test
void shouldAccessUrlLocalWithoutContextPath() {
String result = JHLiteApp.accessUrlLocal("http", "8080", "/");
assertThat(result).isEqualTo(" Local: \thttp://localhost:8080/swagger-ui.html" + LF);
assertThat(result).isEqualTo(" Local: \thttp://localhost:8080/" + LF);
}

@Test
void shouldAccessUrlLocalWithContextPath() {
String result = JHLiteApp.accessUrlLocal("http", "8080", "/lite/");
assertThat(result).isEqualTo(" Local: \thttp://localhost:8080/lite/swagger-ui.html" + LF);
assertThat(result).isEqualTo(" Local: \thttp://localhost:8080/lite/" + LF);
}

@Test
Expand All @@ -75,13 +75,13 @@ void shouldAccessUrlExternalWithoutServerPort() {
@Test
void shouldAccessUrlExternalWithoutContextPath() {
String result = JHLiteApp.accessUrlExternal("http", "127.0.1.1", "8080", "/");
assertThat(result).isEqualTo(" External: \thttp://127.0.1.1:8080/swagger-ui.html" + LF);
assertThat(result).isEqualTo(" External: \thttp://127.0.1.1:8080/" + LF);
}

@Test
void shouldAccessUrlExternalWithContextPath() {
String result = JHLiteApp.accessUrlExternal("http", "127.0.1.1", "8080", "/lite/");
assertThat(result).isEqualTo(" External: \thttp://127.0.1.1:8080/lite/swagger-ui.html" + LF);
assertThat(result).isEqualTo(" External: \thttp://127.0.1.1:8080/lite/" + LF);
}

@Test
Expand Down

0 comments on commit 8924da4

Please sign in to comment.