diff options
Diffstat (limited to 'main/src/test/java')
-rw-r--r-- | main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java b/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java index 4bcd86ca..5896b352 100644 --- a/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java +++ b/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java @@ -107,7 +107,10 @@ class TestApiRestServer extends CommonTestRestController { private static final String POLICIES = "policies"; + private static final String TOSCA_POLICY_VER_RESOURCE = + "policytypes/onap.restart.tca.snapshot.yaml"; // @formatter:off + private static final String[] TOSCA_POLICY_RESOURCE_NAMES = {"policies/vCPE.policy.monitoring.input.tosca.json", "policies/vCPE.policy.monitoring.input.tosca.yaml", "policies/vDNS.policy.monitoring.input.tosca.json", "policies/vDNS.policy.monitoring.input.tosca.v2.yaml"}; @@ -118,6 +121,9 @@ class TestApiRestServer extends CommonTestRestController { private static final String TOSCA_POLICYTYPE_OP_RESOURCE = "policytypes/onap.policies.controlloop.operational.Common.yaml"; + private static final String TOSCA_POLICYTYPE_VER_RESOURCE = + "policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.snapshot.yaml"; + private static final String[] TOSCA_POLICYTYPE_RESOURCE_NAMES = { "policytypes/onap.policies.monitoring.tcagen2.yaml", "policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml", @@ -250,6 +256,15 @@ class TestApiRestServer extends CommonTestRestController { .contains("item \"policy type\" value \"IDontExist:1.0.0\" INVALID, not found"); } + @Test + void testPoliciesVersioning() throws Exception { + var rawResponse = createResource(POLICYTYPES, TOSCA_POLICYTYPE_VER_RESOURCE, apiPort); + assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); + + rawResponse = createResource(POLICIES, TOSCA_POLICY_VER_RESOURCE, apiPort); + assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); + } + @SuppressWarnings("unchecked") @Test void testToscaCompliantOpDroolsPolicies() throws Exception { |