diff --git a/README.md b/README.md index cfa7f45f..a015f73c 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Also try for example 'admin@xxx.example.com' or 'unknown@example.org'. If you want a formatted JSON output, you can pipe the result to `jq` or similar. -And to see the full, currently implemented, API, open http://localhost:8080/swagger-ui/index.html. +And to see the full, currently implemented, API, open http://localhost:8081/actuator/swagger-ui/index.html (uses management-port and thus bypasses authentication). If you still need to install some of these tools, find some hints in the next chapters. diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 69ad1e1b..f6a6fe88 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -9,7 +9,7 @@ management: web: exposure: # HOWTO: view _clickable_ Spring Actuator (Micrometer) Metrics endpoints: http://localhost:8081/actuator/metric-links - include: info, health, metrics, metric-links + include: info, health, metrics, metric-links, mappings, openapi, swaggerui observations: annotations: enabled: true @@ -30,6 +30,10 @@ spring: hibernate: dialect: net.hostsharing.hsadminng.config.PostgresCustomDialect +# keep this in sync with test/.../application.yml +springdoc: + use-management-port: true + liquibase: contexts: dev diff --git a/src/test/java/net/hostsharing/hsadminng/config/WebSecurityConfigIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/config/WebSecurityConfigIntegrationTest.java index 586702c2..00444c3a 100644 --- a/src/test/java/net/hostsharing/hsadminng/config/WebSecurityConfigIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/config/WebSecurityConfigIntegrationTest.java @@ -82,14 +82,14 @@ class WebSecurityConfigIntegrationTest { @Test public void shouldSupportSwaggerUi() { final var result = this.restTemplate.getForEntity( - "http://localhost:" + this.managementPort + "/swagger-ui/index.html", String.class); + "http://localhost:" + this.managementPort + "/actuator/swagger-ui/index.html", String.class); assertThat(result.getStatusCode()).isEqualTo(HttpStatus.OK); } @Test public void shouldSupportApiDocs() { final var result = this.restTemplate.getForEntity( - "http://localhost:" + this.managementPort + "/v3/api-docs/swagger-config", String.class); + "http://localhost:" + this.managementPort + "/actuator/v3/api-docs/swagger-config", String.class); assertThat(result.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); // permitted but not configured } diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index a69f8aa1..954bdd63 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -39,6 +39,10 @@ spring: change-log: classpath:/db/changelog/db.changelog-master.yaml contexts: tc,test,dev,pg_stat_statements +# keep this in sync with main/.../application.yml +springdoc: + use-management-port: true + logging: level: liquibase: WARN