Skip to content

Commit

Permalink
Unexpected path behaviour when using management port (actuator). Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bnasslahsen committed Apr 21, 2022
1 parent d2e71dc commit 3623b6e
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 25 deletions.
Expand Up @@ -359,7 +359,7 @@ public final class Constants {
/**
* The constant DEFAULT_SWAGGER_UI_ACTUATOR_PATH.
*/
public static final String DEFAULT_SWAGGER_UI_ACTUATOR_PATH = "swaggerui";
public static final String DEFAULT_SWAGGER_UI_ACTUATOR_PATH = "swagger-ui";

/**
* The constant DEFAULT_API_DOCS_ACTUATOR_URL.
Expand Down
Expand Up @@ -48,13 +48,13 @@ void testIndex() throws Exception {

@Test
public void testIndexActuator() {
String contentAsString = actuatorRestTemplate.getForObject("/application/swaggerui", String.class);
String contentAsString = actuatorRestTemplate.getForObject("/application/swagger-ui", String.class);
assertTrue(contentAsString.contains("Swagger UI"));
}

@Test
public void testIndexSwaggerConfig() throws Exception {
String contentAsString = actuatorRestTemplate.getForObject("/application/swaggerui/swagger-config", String.class);
String contentAsString = actuatorRestTemplate.getForObject("/application/swagger-ui/swagger-config", String.class);
String expected = getContent("results/app13-1.json");
assertEquals(expected, contentAsString, true);
}
Expand Down
Expand Up @@ -48,13 +48,13 @@ void testIndex() throws Exception {

@Test
public void testIndexActuator() {
String contentAsString = actuatorRestTemplate.getForObject("/application/swaggerui", String.class);
String contentAsString = actuatorRestTemplate.getForObject("/application/swagger-ui", String.class);
assertTrue(contentAsString.contains("Swagger UI"));
}

@Test
public void testIndexSwaggerConfig() throws Exception {
String contentAsString = actuatorRestTemplate.getForObject("/application/swaggerui/swagger-config", String.class);
String contentAsString = actuatorRestTemplate.getForObject("/application/swagger-ui/swagger-config", String.class);
String expected = getContent("results/app14-1.json");
assertEquals(expected, contentAsString, true);
}
Expand Down
Expand Up @@ -51,13 +51,13 @@ void testIndex() throws Exception {

@Test
public void testIndexActuator() {
String contentAsString = actuatorRestTemplate.getForObject("/test/application/swaggerui", String.class);
String contentAsString = actuatorRestTemplate.getForObject("/test/application/swagger-ui", String.class);
assertTrue(contentAsString.contains("Swagger UI"));
}

@Test
public void testIndexSwaggerConfig() throws Exception {
String contentAsString = actuatorRestTemplate.getForObject("/test/application/swaggerui/swagger-config", String.class);
String contentAsString = actuatorRestTemplate.getForObject("/test/application/swagger-ui/swagger-config", String.class);
String expected = getContent("results/app15-1.json");
assertEquals(expected, contentAsString, true);
}
Expand Down
Expand Up @@ -51,13 +51,13 @@ void testIndex() throws Exception {

@Test
public void testIndexActuator() {
String contentAsString = actuatorRestTemplate.getForObject("/test/application/swaggerui", String.class);
String contentAsString = actuatorRestTemplate.getForObject("/test/application/swagger-ui", String.class);
assertTrue(contentAsString.contains("Swagger UI"));
}

@Test
public void testIndexSwaggerConfig() throws Exception {
String contentAsString = actuatorRestTemplate.getForObject("/test/application/swaggerui/swagger-config", String.class);
String contentAsString = actuatorRestTemplate.getForObject("/test/application/swagger-ui/swagger-config", String.class);
String expected = getContent("results/app16-1.json");
assertEquals(expected, contentAsString, true);
}
Expand Down
@@ -1,5 +1,5 @@
{
"configUrl": "/application/swaggerui/swagger-config",
"configUrl": "/application/swagger-ui/swagger-config",
"oauth2RedirectUrl": "http://localhost:9092/application/swagger-ui/oauth2-redirect.html",
"url": "/application/openapi",
"validatorUrl": ""
Expand Down
@@ -1,5 +1,5 @@
{
"configUrl": "/application/swaggerui/swagger-config",
"configUrl": "/application/swagger-ui/swagger-config",
"oauth2RedirectUrl": "http://localhost:9093/application/swagger-ui/oauth2-redirect.html",
"urls": [
{
Expand Down
@@ -1,5 +1,5 @@
{
"configUrl": "/test/application/swaggerui/swagger-config",
"configUrl": "/test/application/swagger-ui/swagger-config",
"oauth2RedirectUrl": "http://localhost:9094/test/application/swagger-ui/oauth2-redirect.html",
"url": "/test/application/openapi",
"validatorUrl": ""
Expand Down
@@ -1,5 +1,5 @@
{
"configUrl": "/test/application/swaggerui/swagger-config",
"configUrl": "/test/application/swagger-ui/swagger-config",
"oauth2RedirectUrl": "http://localhost:9095/test/application/swagger-ui/oauth2-redirect.html",
"urls": [
{
Expand Down
Expand Up @@ -54,14 +54,14 @@ void testIndex() {

@Test
public void testIndexActuator() {
HttpStatus httpStatusMono = webClient.get().uri("/application/swaggerui")
HttpStatus httpStatusMono = webClient.get().uri("/application/swagger-ui")
.exchangeToMono( clientResponse -> Mono.just(clientResponse.statusCode())).block();
assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND);
}

@Test
public void testIndexSwaggerConfig() throws Exception {
String contentAsString = webClient.get().uri("/application/swaggerui/swagger-config").retrieve()
String contentAsString = webClient.get().uri("/application/swagger-ui/swagger-config").retrieve()
.bodyToMono(String.class).block();
String expected = getContent("results/app13-1.json");
assertEquals(expected, contentAsString, true);
Expand Down
Expand Up @@ -53,14 +53,14 @@ void testIndex() {

@Test
public void testIndexActuator() {
HttpStatus httpStatusMono = webClient.get().uri("/application/swaggerui")
HttpStatus httpStatusMono = webClient.get().uri("/application/swagger-ui")
.exchangeToMono( clientResponse -> Mono.just(clientResponse.statusCode())).block();
assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND);
}

@Test
public void testIndexSwaggerConfig() throws Exception {
String contentAsString = webClient.get().uri("/application/swaggerui/swagger-config").retrieve()
String contentAsString = webClient.get().uri("/application/swagger-ui/swagger-config").retrieve()
.bodyToMono(String.class).block();
String expected = getContent("results/app14-1.json");
assertEquals(expected, contentAsString, true);
Expand Down
Expand Up @@ -56,14 +56,14 @@ void testIndex() {

@Test
public void testIndexActuator() {
HttpStatus httpStatusMono = webClient.get().uri("/test/application/swaggerui")
HttpStatus httpStatusMono = webClient.get().uri("/test/application/swagger-ui")
.exchangeToMono( clientResponse -> Mono.just(clientResponse.statusCode())).block();
assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND);
}

@Test
public void testIndexSwaggerConfig() throws Exception {
String contentAsString = webClient.get().uri("/test/application/swaggerui/swagger-config").retrieve()
String contentAsString = webClient.get().uri("/test/application/swagger-ui/swagger-config").retrieve()
.bodyToMono(String.class).block();
String expected = getContent("results/app15-1.json");
assertEquals(expected, contentAsString, true);
Expand Down
Expand Up @@ -55,14 +55,14 @@ void testIndex() {

@Test
public void testIndexActuator() {
HttpStatus httpStatusMono = webClient.get().uri("/test/application/swaggerui")
HttpStatus httpStatusMono = webClient.get().uri("/test/application/swagger-ui")
.exchangeToMono( clientResponse -> Mono.just(clientResponse.statusCode())).block();
assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND);
}

@Test
public void testIndexSwaggerConfig() throws Exception {
String contentAsString = webClient.get().uri("/test/application/swaggerui/swagger-config").retrieve()
String contentAsString = webClient.get().uri("/test/application/swagger-ui/swagger-config").retrieve()
.bodyToMono(String.class).block();
String expected = getContent("results/app16-1.json");
assertEquals(expected, contentAsString, true);
Expand Down
@@ -1,5 +1,5 @@
{
"configUrl": "/application/swaggerui/swagger-config",
"configUrl": "/application/swagger-ui/swagger-config",
"oauth2RedirectUrl": "http://localhost:9092/application/webjars/swagger-ui/oauth2-redirect.html",
"url": "/application/openapi",
"validatorUrl": ""
Expand Down
@@ -1,5 +1,5 @@
{
"configUrl": "/application/swaggerui/swagger-config",
"configUrl": "/application/swagger-ui/swagger-config",
"oauth2RedirectUrl": "http://localhost:9093/application/webjars/swagger-ui/oauth2-redirect.html",
"urls": [
{
Expand Down
@@ -1,5 +1,5 @@
{
"configUrl": "/test/application/swaggerui/swagger-config",
"configUrl": "/test/application/swagger-ui/swagger-config",
"oauth2RedirectUrl": "http://localhost:9094/test/application/webjars/swagger-ui/oauth2-redirect.html",
"url": "/test/application/openapi",
"validatorUrl": ""
Expand Down
@@ -1,5 +1,5 @@
{
"configUrl": "/test/application/swaggerui/swagger-config",
"configUrl": "/test/application/swagger-ui/swagger-config",
"oauth2RedirectUrl": "http://localhost:9095/test/application/webjars/swagger-ui/oauth2-redirect.html",
"urls": [
{
Expand Down

0 comments on commit 3623b6e

Please sign in to comment.