diff options
Diffstat (limited to 'src/test/java/org/onap')
4 files changed, 1 insertions, 80 deletions
diff --git a/src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java b/src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java index c57ddbfd..22abb13d 100644 --- a/src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java +++ b/src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java @@ -35,13 +35,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.onap.clamp.clds.AbstractIT; import org.onap.clamp.clds.client.req.OperationalPolicyReq; -import org.onap.clamp.clds.client.req.StringMatchPolicyReq; import org.onap.clamp.clds.client.req.TcaMPolicyReq; import org.onap.clamp.clds.model.CldsEvent; import org.onap.clamp.clds.model.prop.ModelProperties; import org.onap.clamp.clds.model.prop.Policy; import org.onap.clamp.clds.model.prop.PolicyChain; -import org.onap.clamp.clds.model.prop.StringMatch; import org.onap.clamp.clds.model.prop.Tca; import org.onap.clamp.clds.util.ResourceFileUtil; import org.onap.policy.api.AttributeType; @@ -74,24 +72,6 @@ public class PolicyClientIT extends AbstractIT { controlName = "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf"; } - private void createUpdateStringMatch(String actionCd) throws Exception { - ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp); - StringMatch stringMatch = prop.getType(StringMatch.class); - if (stringMatch.isFound()) { - String stringMatchPolicyRequestUuid = UUID.randomUUID().toString(); - - String policyJson = StringMatchPolicyReq.format(refProp, prop); - String correctValue = ResourceFileUtil.getResourceAsString("expected/stringmatch.json"); - JSONAssert.assertEquals(policyJson, correctValue, true); - String responseMessage = ""; - try { - responseMessage = policyClient.sendMicroServiceInJson(policyJson, prop, stringMatchPolicyRequestUuid); - } catch (Exception e) { - assertTrue(e.getMessage().contains("Policy send failed: PE500 ")); - } - } - } - private void createUpdateOperationalPolicy(String actionCd) throws Exception { ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp); Policy policy = prop.getType(Policy.class); @@ -123,21 +103,6 @@ public class PolicyClientIT extends AbstractIT { } } - private void deleteStringMatchPolicy(String actionCd) throws Exception { - ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp); - - StringMatch stringMatch = prop.getType(StringMatch.class); - if (stringMatch.isFound()) { - prop.setCurrentModelElementId(stringMatch.getId()); - String responseMessage = ""; - try { - responseMessage = policyClient.deleteMicrosService(prop); - } catch (Exception e) { - assertTrue(e.getMessage().contains("Policy delete failed: PE500 ")); - } - } - } - private void deleteOperationalPolicy(String actionCd) throws Exception { ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp); @@ -170,19 +135,6 @@ public class PolicyClientIT extends AbstractIT { /** * Temporarily disabled Test. */ - public void testCreateUpdateDeleteStringMatchPolicy() throws Exception { - - createUpdateStringMatch(CldsEvent.ACTION_SUBMIT); - - TimeUnit.SECONDS.sleep(20); - - deleteStringMatchPolicy(CldsEvent.ACTION_DELETE); - } - - // @Test - /** - * Temporarily disabled Test. - */ public void testCreateUpdateDeleteOperationalPolicy() throws Exception { createUpdateOperationalPolicy(CldsEvent.ACTION_SUBMIT); diff --git a/src/test/java/org/onap/clamp/clds/it/RefPropIT.java b/src/test/java/org/onap/clamp/clds/it/RefPropIT.java index 473ce4a2..4617f5b4 100644 --- a/src/test/java/org/onap/clamp/clds/it/RefPropIT.java +++ b/src/test/java/org/onap/clamp/clds/it/RefPropIT.java @@ -51,7 +51,7 @@ public class RefPropIT extends AbstractIT { */ @Test public void testJsonTemplate() throws IOException { - ObjectNode root = (ObjectNode) refProp.getJsonTemplate("sm.template"); + ObjectNode root = (ObjectNode) refProp.getJsonTemplate("tca.template"); root.put("closedLoopControlName", "ClosedLoop-FRWL-SIG-1582f840-2881-11e6-b4ec-005056a9d756"); ObjectMapper mapper = new ObjectMapper(); diff --git a/src/test/java/org/onap/clamp/clds/it/SdcIT.java b/src/test/java/org/onap/clamp/clds/it/SdcIT.java index 8883af25..46ac4089 100644 --- a/src/test/java/org/onap/clamp/clds/it/SdcIT.java +++ b/src/test/java/org/onap/clamp/clds/it/SdcIT.java @@ -58,21 +58,6 @@ public class SdcIT extends AbstractIT { } @Test - public void testBlueprint() throws Exception { - String modelProp = ResourceFileUtil.getResourceAsString("example/modelProp.json"); - String modelBpmnProp = ResourceFileUtil.getResourceAsString("example/modelBpmnProp.json"); - String modelName = "example-model06"; - String controlName = "ClosedLoop-FRWL-SIG04-1582f840-test-test-1234-005056a9d756"; - String docText = ResourceFileUtil.getResourceAsString("example/templateProp.json"); - ModelProperties prop = new ModelProperties(modelName, controlName, CldsEvent.ACTION_SUBMIT, - true, modelBpmnProp, modelProp); - String blueprint = SdcReq.formatBlueprint(refProp, prop, docText); - System.out.println("blueprint=" + blueprint); - //assertEquals(blueprint, ""); - } - - - @Test public void testTcaBlueprint() throws Exception { String modelProp = ResourceFileUtil.getResourceAsString("example/modelPropForPolicy.json"); String modelBpmnProp = ResourceFileUtil.getResourceAsString("example/modelBpmnPropForPolicy.json"); diff --git a/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java b/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java index f87bd37d..60056d42 100644 --- a/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java +++ b/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java @@ -54,22 +54,6 @@ public class ModelPropertiesTest { ModelProperties prop = new ModelProperties("example-model-name", "example-control-name", null, true, modelBpmn, modelBpmnProp); - StringMatch stringMatch = prop.getType(StringMatch.class); - assertTrue(stringMatch.isFound()); - assertEquals("1505133578560", stringMatch.getResourceGroups().get(0).getGroupNumber()); - assertEquals("0", stringMatch.getResourceGroups().get(0).getPolicyId()); - assertEquals(1, stringMatch.getResourceGroups().get(0).getServiceConfigurations().size()); - List<String> aaiMathcingFields = new ArrayList<String>(); - aaiMathcingFields.add("complex.city"); - assertEquals(aaiMathcingFields, - stringMatch.getResourceGroups().get(0).getServiceConfigurations().get(0).getaaiMatchingFields()); - assertEquals("1600", stringMatch.getResourceGroups().get(0).getServiceConfigurations().get(0).getAgeLimit()); - assertEquals(1, stringMatch.getResourceGroups().get(0).getServiceConfigurations().get(0).getStringSet().size()); - - Collector collector = prop.getType(Collector.class); - assertTrue(collector.isFound()); - assertEquals("DCAE-COLLECTOR-UCSNMP", collector.getTopicPublishes()); - Policy policy = prop.getType(Policy.class); assertTrue(policy.isFound()); assertEquals(1, policy.getPolicyChains().size()); |