Change json representation in op policy
[clamp.git] / src / test / java / org / onap / clamp / loop / LoopToJsonTest.java
index 34d524a..6c7836e 100644 (file)
@@ -54,7 +54,7 @@ public class LoopToJsonTest {
 
     private OperationalPolicy getOperationalPolicy(String configJson, String name) {
         return new OperationalPolicy(name, null, gson.fromJson(configJson, JsonObject.class),
-                getPolicyModel("org.onap.policy.drools", "yaml", "1.0.0", "Drools", "type1"), null);
+                getPolicyModel("org.onap.policy.drools.legacy", "yaml", "1.0.0", "Drools", "type1"), null,null,null);
     }
 
     private Loop getLoop(String name, String svgRepresentation, String blueprint, String globalPropertiesJson,
@@ -72,7 +72,7 @@ public class LoopToJsonTest {
                                                      String policyTosca, String jsonProperties, boolean shared) {
         MicroServicePolicy microService = new MicroServicePolicy(name, new PolicyModel(modelType, policyTosca, "1.0.0"),
                 shared,
-                gson.fromJson(jsonRepresentation, JsonObject.class), null);
+                gson.fromJson(jsonRepresentation, JsonObject.class), null, null, null);
         microService.setConfigurationsJson(new Gson().fromJson(jsonProperties, JsonObject.class));
         return microService;
     }
@@ -173,25 +173,4 @@ public class LoopToJsonTest {
         assertThat(loopTestDeserialized).isEqualToIgnoringGivenFields(loopTest2, "modelService", "svgRepresentation",
                 "blueprint", "components");
     }
-
-    /**
-     * This tests the GSON encode/decode of pdpGroup.
-     *
-     * @throws IOException In case of issues
-     */
-    @Test
-    public void createPoliciesPayloadPdpGroupTest() throws IOException {
-        Loop loopTest = getLoop("ControlLoopTest", "<xml></xml>", "yamlcontent", "{\"testname\":\"testvalue\"}",
-                "123456789", "https://dcaetest.org", "UUID-blueprint");
-        OperationalPolicy opPolicy = this.getOperationalPolicy(
-                ResourceFileUtil.getResourceAsString("tosca/operational-policy-properties.json"), "GuardOpPolicyTest");
-        loopTest.addOperationalPolicy(opPolicy);
-        MicroServicePolicy microServicePolicy = getMicroServicePolicy("configPolicyTest", "",
-                "{\"configtype\":\"json\"}", "tosca_definitions_version: tosca_simple_yaml_1_0_0",
-                "{\"param1\":\"value1\"}", true);
-        loopTest.addMicroServicePolicy(microServicePolicy);
-
-        JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/pdp-group-policy-payload.json"),
-                PolicyComponent.createPoliciesPayloadPdpGroup(loopTest), false);
-    }
 }