summaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-03-03 12:37:27 -0500
committerRam Krishna Verma <ram_krishna.verma@bell.ca>2020-03-03 16:43:00 -0500
commit5949dbc9b1a3648a9d9f4046e565d0ca8be9149a (patch)
treed7b32d3ba5816d5efb4ae9ff7e9b951d75a53c36 /main/src/test/java/org/onap
parent26df4c98fb4f1467a405608f761100575bbc34f8 (diff)
Removing deployed from policy/api
The deployed API has already been created in PAP as part of Policy Update Notifications work. Removing the corresponding one from policy/api to make sure that all run time administration of PdpGroup and deployed policies are done only via PAP. Leaving the deployed API's in legacy controller as they will be removed together. Issue-ID: POLICY-1941 Change-Id: Ibe131f1aab3ec6a0eec05a2c91b5a140efc61b72 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
Diffstat (limited to 'main/src/test/java/org/onap')
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java22
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java17
2 files changed, 0 insertions, 39 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 7780ea7d..95a20692 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
@@ -38,7 +38,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.ws.rs.client.Client;
@@ -47,7 +46,6 @@ import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
-
import org.glassfish.jersey.client.ClientProperties;
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
import org.junit.AfterClass;
@@ -882,26 +880,6 @@ public class TestApiRestServer {
}
@Test
- public void testGetDeployedVersionsOfPolicyJson() throws Exception {
- testGetDeployedVersionsOfPolicy(APP_JSON);
- }
-
- @Test
- public void testGetDeployedVersionsOfPolicyYaml() throws Exception {
- testGetDeployedVersionsOfPolicy(APP_YAML);
- }
-
- private void testGetDeployedVersionsOfPolicy(String mediaType) throws Exception {
- Response rawResponse = readResource(POLICYTYPES_TCA_POLICIES_VCPE_DEPLOYED, mediaType);
- assertEquals(Response.Status.NOT_FOUND.getStatusCode(), rawResponse.getStatus());
- ErrorResponse errorResponse = rawResponse.readEntity(ErrorResponse.class);
- assertEquals(
- "could not find policy with ID onap.restart.tca and type "
- + "onap.policies.monitoring.cdap.tca.hi.lo.app:1.0.0 deployed in any pdp group",
- errorResponse.getErrorMessage());
- }
-
- @Test
public void testGetLatestVersionOfOperationalPolicyJson() throws Exception {
testGetLatestVersionOfOperationalPolicy(APP_JSON);
}
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 be9b5838..f458013d 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
@@ -34,7 +34,6 @@ import java.util.ArrayList;
import java.util.Base64;
import java.util.Collections;
import java.util.List;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -158,11 +157,6 @@ public class TestPolicyProvider {
String policyTypeVersion = "1.0.0";
String policyTypeId = "onap.policies.monitoring.cdap.tca.hi.lo.app";
- // Basic Exception Throw
- assertThatThrownBy(() -> {
- policyProvider.fetchDeployedPolicies("dummy", "1.0.0", "dummy");
- }).hasMessage("could not find policy with ID dummy and type dummy:1.0.0 deployed in any pdp group");
-
try (PolicyModelsProvider databaseProvider =
new PolicyModelsProviderFactory().createPolicyModelsProvider(providerParams)) {
assertEquals(0, databaseProvider.getPdpGroups("name").size());
@@ -216,23 +210,12 @@ public class TestPolicyProvider {
assertFalse(serviceTemplate.getToscaTopologyTemplate().getPolicies().get(0).isEmpty());
}).doesNotThrowAnyException();
- // Test fetchDeployedPolicies (deployedPolicyMap.isEmpty())==true
- assertThatThrownBy(() -> {
- policyProvider.fetchDeployedPolicies(policyTypeId, policyTypeVersion, policyId);
- }).hasMessage("could not find policy with ID " + policyId + " and type " + policyTypeId + ":"
- + policyTypeVersion + " deployed in any pdp group");
-
// Update pdpSubGroup
pdpSubGroup.setPolicies(new ArrayList<>());
pdpSubGroup.getPolicies().add(new ToscaPolicyIdentifier(policyId, policyVersion));
assertEquals(1,
databaseProvider.createPdpGroups(groupList).get(0).getPdpSubgroups().get(0).getPolicies().size());
- // Test fetchDeployedPolicies
- assertThatCode(() -> {
- policyProvider.fetchDeployedPolicies(policyTypeId, policyTypeVersion, policyId);
- }).doesNotThrowAnyException();
-
// Test validateDeleteEligibility exception path(!pdpGroups.isEmpty())
assertThatThrownBy(() -> {
policyProvider.deletePolicy("onap.policies.monitoring.cdap.tca.hi.lo.app", "1.0.0", "onap.restart.tca",