diff options
author | xg353y <xg353y@intl.att.com> | 2017-09-27 13:21:21 +0200 |
---|---|---|
committer | xg353y <xg353y@intl.att.com> | 2017-09-27 17:41:27 +0200 |
commit | bc25b72025a7b92c2b1bb7a3f0cfcd9ddedba001 (patch) | |
tree | 08a54b4fdb46718ccb79c95af289f119b6389888 /src/test/java/org | |
parent | 608120c4b86ebf23713e14609d12883c0540e661 (diff) |
Code Improvement
Change-Id: I703aabf234cb656b1faea3b5c0776d034d8ec807
Signed-off-by: xg353y <xg353y@intl.att.com>
Issue-ID: CLAMP-54
Diffstat (limited to 'src/test/java/org')
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 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); @@ -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 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 @@ -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 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<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()); |