diff options
author | liamfallon <liam.fallon@est.tech> | 2022-12-01 15:24:57 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2022-12-06 12:53:44 +0000 |
commit | cf5af3fd2e67b0aef402114a0f3ae263fdfc7efe (patch) | |
tree | 844e1f34ffe75187e1a76ebbfe724874f2dba188 /participant/participant-impl/participant-impl-acelement/src/test/java | |
parent | 7af90cd8fdabdd1c3ae79d3551980016d6b24f7e (diff) |
Replace SpringFox with SpringDoc in CLAMP
This commit:
- Remove springfox from CLAMP
- updates the commissioning, AC Element, and K8S particiapnt to use the
generated interface rather than the hard coded one
- removes swagger annotations from handwritten code
- implements SpringDoc for the <base_path>/v3/api-docs on endpoints
Issue-ID: POLICY-4404
Change-Id: I49f48bc7828cb49dab854ef9ed16a9aa377983e1
Signed-off-by: liamfallon <liam.fallon@est.tech>
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()); + } } |