diff options
Diffstat (limited to 'participant/participant-impl/participant-impl-acelement/src/test/java')
2 files changed, 20 insertions, 7 deletions
diff --git a/participant/participant-impl/participant-impl-acelement/src/test/java/org/onap/policy/clamp/acm/element/rest/AcElementControllerTest.java b/participant/participant-impl/participant-impl-acelement/src/test/java/org/onap/policy/clamp/acm/element/rest/AcElementControllerTest.java index 001b2be3b..1d19b1a17 100644 --- a/participant/participant-impl/participant-impl-acelement/src/test/java/org/onap/policy/clamp/acm/element/rest/AcElementControllerTest.java +++ b/participant/participant-impl/participant-impl-acelement/src/test/java/org/onap/policy/clamp/acm/element/rest/AcElementControllerTest.java @@ -67,9 +67,9 @@ class AcElementControllerTest { private static final Coder CODER = new StandardCoder(); private static final String ELEMENT_CONFIG_YAML = "src/test/resources/config.json"; - private static final String RETRIEVE_CONFIG = "/onap/policy/clamp/acelement/v2/config"; - private static final String ACTIVATE_CONFIG = "/onap/policy/clamp/acelement/v2/activate"; - private static final String DEACTIVATE_CONFIG = "/onap/policy/clamp/acelement/v2/deactivate"; + private static final String RETRIEVE_CONFIG = "/config"; + private static final String ACTIVATE_CONFIG = "/activate"; + private static final String DEACTIVATE_CONFIG = "/deactivate"; private static ElementConfig config; diff --git a/participant/participant-impl/participant-impl-acelement/src/test/java/org/onap/policy/clamp/acm/element/rest/ActuatorControllerTest.java b/participant/participant-impl/participant-impl-acelement/src/test/java/org/onap/policy/clamp/acm/element/rest/ActuatorControllerTest.java index 489056adc..81c4b087c 100644 --- a/participant/participant-impl/participant-impl-acelement/src/test/java/org/onap/policy/clamp/acm/element/rest/ActuatorControllerTest.java +++ b/participant/participant-impl/participant-impl-acelement/src/test/java/org/onap/policy/clamp/acm/element/rest/ActuatorControllerTest.java @@ -41,9 +41,10 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; @ActiveProfiles("test") class ActuatorControllerTest extends CommonActuatorController { - private static final String HEALTH_ENDPOINT = "health"; - private static final String METRICS_ENDPOINT = "metrics"; - private static final String PROMETHEUS_ENDPOINT = "prometheus"; + private static final String HEALTH_ENDPOINT = "onap/policy/clamp/acelement/v2/health/"; + private static final String METRICS_ENDPOINT = "onap/policy/clamp/acelement/v2/metrics/"; + private static final String PROMETHEUS_ENDPOINT = "onap/policy/clamp/acelement/v2/prometheus/"; + private static final String SWAGGER_ENDPOINT = "onap/policy/clamp/acelement/v2/v3/api-docs/"; @LocalServerPort private int randomServerPort; @@ -69,6 +70,11 @@ class ActuatorControllerTest extends CommonActuatorController { } @Test + void testGetSwagger_Unauthorized() throws Exception { + assertUnauthorizedActGet(SWAGGER_ENDPOINT); + } + + @Test void testGetHealth() throws Exception { Invocation.Builder invocationBuilder = super.sendActRequest(HEALTH_ENDPOINT); Response rawresp = invocationBuilder.buildGet().invoke(); @@ -83,9 +89,16 @@ class ActuatorControllerTest extends CommonActuatorController { } @Test - void testGePrometheus() throws Exception { + void testGetPrometheus() throws Exception { Invocation.Builder invocationBuilder = super.sendActRequest(PROMETHEUS_ENDPOINT); Response rawresp = invocationBuilder.buildGet().invoke(); assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus()); } + + @Test + void testGetSwagger() throws Exception { + Invocation.Builder invocationBuilder = super.sendActRequest(SWAGGER_ENDPOINT); + Response rawresp = invocationBuilder.buildGet().invoke(); + assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus()); + } } |