diff options
Diffstat (limited to 'main/src/test/java')
-rw-r--r-- | main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java | 22 | ||||
-rw-r--r-- | main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java | 17 |
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", |