Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove swagger url when starting the application #1371

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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