summaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-12-10 07:34:36 -0500
committerPamela Dragosh <pdragosh@research.att.com>2019-12-11 08:33:01 -0500
commitaff0352cc138a494ec105947d446a54d5fa035cf (patch)
tree216a60e5cda07057b0b2ecf51485d5c92e7607a3 /main/src/test/java/org/onap
parent7f4f871ec1d43adacbb12dfd8ee93ebec8dc52d7 (diff)
Update preload optimization types
The type names were updated and added 2 new types. Issue-ID: POLICY-2066 Change-Id: Ibbd149dec1809a9a815a5f6b64a8e7855fcc2010 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'main/src/test/java/org/onap')
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java30
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java18
2 files changed, 24 insertions, 24 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 8ede8815..3636d625 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
@@ -186,15 +186,15 @@ public class TestApiRestServer {
"policytypes/onap.policies.controlloop.guard.FrequencyLimiter.yaml",
"policytypes/onap.policies.controlloop.guard.MinMax.yaml",
"policytypes/onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml",
- "policytypes/onap.policies.optimization.AffinityPolicy.yaml",
- "policytypes/onap.policies.optimization.DistancePolicy.yaml",
- "policytypes/onap.policies.optimization.HpaPolicy.yaml",
- "policytypes/onap.policies.optimization.OptimizationPolicy.yaml",
- "policytypes/onap.policies.optimization.PciPolicy.yaml",
- "policytypes/onap.policies.optimization.QueryPolicy.yaml",
- "policytypes/onap.policies.optimization.SubscriberPolicy.yaml",
- "policytypes/onap.policies.optimization.Vim_fit.yaml",
- "policytypes/onap.policies.optimization.VnfPolicy.yaml"
+ "policytypes/onap.policies.optimization.resource.AffinityPolicy.yaml",
+ "policytypes/onap.policies.optimization.resource.DistancePolicy.yaml",
+ "policytypes/onap.policies.optimization.resource.HpaPolicy.yaml",
+ "policytypes/onap.policies.optimization.resource.OptimizationPolicy.yaml",
+ "policytypes/onap.policies.optimization.resource.PciPolicy.yaml",
+ "policytypes/onap.policies.optimization.service.QueryPolicy.yaml",
+ "policytypes/onap.policies.optimization.service.SubscriberPolicy.yaml",
+ "policytypes/onap.policies.optimization.resource.Vim_fit.yaml",
+ "policytypes/onap.policies.optimization.resource.VnfPolicy.yaml"
};
private String[] legacyGuardPolicyResourceNames = {
@@ -318,8 +318,8 @@ public class TestApiRestServer {
Response rawResponse = createResource(POLICIES, resrcName, true);
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), rawResponse.getStatus());
ErrorResponse error = rawResponse.readEntity(ErrorResponse.class);
- assertEquals("policy type onap.policies.optimization.AffinityPolicy:0.0.0 for "
- + "policy OSDF_CASABLANCA.Affinity_vCPE_1:1.0.0 does not exist", error.getErrorMessage());
+ assertEquals("policy type onap.policies.optimization.resource.AffinityPolicy:1.0.0 for "
+ + "policy OSDF_CASABLANCA.Affinity_Default:1.0.0 does not exist", error.getErrorMessage());
}
}
@@ -442,8 +442,8 @@ public class TestApiRestServer {
Response rawResponse = createResource(POLICIES, resrcName, false);
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), rawResponse.getStatus());
ErrorResponse error = rawResponse.readEntity(ErrorResponse.class);
- assertEquals("policy type onap.policies.optimization.AffinityPolicy:0.0.0 for "
- + "policy OSDF_CASABLANCA.Affinity_vCPE_1:1.0.0 does not exist", error.getErrorMessage());
+ assertEquals("policy type onap.policies.optimization.resource.AffinityPolicy:1.0.0 for "
+ + "policy OSDF_CASABLANCA.Affinity_Default:1.0.0 does not exist", error.getErrorMessage());
}
}
@@ -704,7 +704,7 @@ public class TestApiRestServer {
Response rawResponse = readResource(POLICYTYPES, true, APP_JSON);
assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus());
ToscaServiceTemplate response = rawResponse.readEntity(ToscaServiceTemplate.class);
- assertEquals(26, response.getPolicyTypes().size());
+ assertEquals(28, response.getPolicyTypes().size());
}
@Test
@@ -714,7 +714,7 @@ public class TestApiRestServer {
Response rawResponse = readResource(POLICYTYPES, true, APP_YAML);
assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus());
ToscaServiceTemplate response = rawResponse.readEntity(ToscaServiceTemplate.class);
- assertEquals(26, response.getPolicyTypes().size());
+ assertEquals(28, response.getPolicyTypes().size());
}
@Test
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java
index 5d0b4128..4221c670 100644
--- a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java
+++ b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java
@@ -80,13 +80,13 @@ public class TestPolicyProvider {
// @formatter:off
private String[] toscaPolicyTypeResourceNames = {
- "policytypes/onap.policies.optimization.AffinityPolicy.yaml",
- "policytypes/onap.policies.optimization.DistancePolicy.yaml",
- "policytypes/onap.policies.optimization.HpaPolicy.yaml",
- "policytypes/onap.policies.optimization.QueryPolicy.yaml",
- "policytypes/onap.policies.optimization.SubscriberPolicy.yaml",
- "policytypes/onap.policies.optimization.Vim_fit.yaml",
- "policytypes/onap.policies.optimization.VnfPolicy.yaml"
+ "policytypes/onap.policies.optimization.resource.AffinityPolicy.yaml",
+ "policytypes/onap.policies.optimization.resource.DistancePolicy.yaml",
+ "policytypes/onap.policies.optimization.resource.HpaPolicy.yaml",
+ "policytypes/onap.policies.optimization.service.QueryPolicy.yaml",
+ "policytypes/onap.policies.optimization.service.SubscriberPolicy.yaml",
+ "policytypes/onap.policies.optimization.resource.Vim_fit.yaml",
+ "policytypes/onap.policies.optimization.resource.VnfPolicy.yaml"
};
// @formatter:on
@@ -285,8 +285,8 @@ public class TestPolicyProvider {
@Test
public void testSimpleCreatePolicy() throws Exception {
- String errorMessage = "policy type onap.policies.optimization.AffinityPolicy:0.0.0 for "
- + "policy OSDF_CASABLANCA.Affinity_vCPE_1:1.0.0 does not exist";
+ String errorMessage = "policy type onap.policies.optimization.resource.AffinityPolicy:1.0.0 for "
+ + "policy OSDF_CASABLANCA.Affinity_Default:1.0.0 does not exist";
assertThatThrownBy(() -> {
String multiPoliciesString = ResourceUtils.getResourceAsString(MULTIPLE_POLICIES_RESOURCE);
ToscaServiceTemplate multiPoliciesServiceTemplate =