From bc25b72025a7b92c2b1bb7a3f0cfcd9ddedba001 Mon Sep 17 00:00:00 2001 From: xg353y Date: Wed, 27 Sep 2017 13:21:21 +0200 Subject: Code Improvement Change-Id: I703aabf234cb656b1faea3b5c0776d034d8ec807 Signed-off-by: xg353y Issue-ID: CLAMP-54 --- .../org/onap/clamp/clds/it/PolicyClientIT.java | 48 ---------------------- .../java/org/onap/clamp/clds/it/RefPropIT.java | 2 +- src/test/java/org/onap/clamp/clds/it/SdcIT.java | 15 ------- .../clamp/clds/model/prop/ModelPropertiesTest.java | 16 -------- 4 files changed, 1 insertion(+), 80 deletions(-) (limited to 'src/test/java/org/onap') 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 c57ddbfd6..22abb13d2 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); @@ -166,19 +131,6 @@ public class PolicyClientIT extends AbstractIT { } } - // @Test - /** - * Temporarily disabled Test. - */ - public void testCreateUpdateDeleteStringMatchPolicy() throws Exception { - - createUpdateStringMatch(CldsEvent.ACTION_SUBMIT); - - TimeUnit.SECONDS.sleep(20); - - deleteStringMatchPolicy(CldsEvent.ACTION_DELETE); - } - // @Test /** * Temporarily disabled Test. 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 473ce4a27..4617f5b42 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 8883af254..46ac4089c 100644 --- a/src/test/java/org/onap/clamp/clds/it/SdcIT.java +++ b/src/test/java/org/onap/clamp/clds/it/SdcIT.java @@ -57,21 +57,6 @@ public class SdcIT extends AbstractIT { System.setProperty("AJSC_CONF_HOME", System.getProperty("user.dir") + "/src/test/resources/"); } - @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"); 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 f87bd37dd..60056d42f 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 aaiMathcingFields = new ArrayList(); - 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()); -- cgit 1.2.3-korg