From dcaebd45961cba194af8b3306d8216851ac27a86 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Fri, 6 Oct 2017 14:09:17 +0200 Subject: Increase the test portability This test was testing the class name provided in the yaml, if it changes the test is dead. So it's more generic now Change-Id: I72ba7ac087da137b0e43628c99b5d92a1696078a Issue-ID: CLAMP-54 Signed-off-by: Determe, Sebastien (sd378r) --- src/test/java/org/onap/clamp/clds/it/OperationPolicyReqItCase.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/test/java/org/onap') diff --git a/src/test/java/org/onap/clamp/clds/it/OperationPolicyReqItCase.java b/src/test/java/org/onap/clamp/clds/it/OperationPolicyReqItCase.java index c7084b64..8fba5736 100644 --- a/src/test/java/org/onap/clamp/clds/it/OperationPolicyReqItCase.java +++ b/src/test/java/org/onap/clamp/clds/it/OperationPolicyReqItCase.java @@ -75,6 +75,9 @@ public class OperationPolicyReqItCase extends AbstractItCase { yaml = yaml.replaceAll("trigger_policy: (.*)", "trigger_policy: "); yaml = yaml.replaceAll("id: (.*)", "id: "); yaml = yaml.replaceAll("success: (.*)", "success: "); + // Remove this field as not always present (depends of policy api) + yaml = yaml.replaceAll(" pnf: null", ""); + yaml = yaml.substring(yaml.indexOf("controlLoop:"), yaml.length()); assertEquals(ResourceFileUtil.getResourceAsString("example/operational-policy/yaml-policy-chain-1.yaml"), yaml); @@ -82,6 +85,9 @@ public class OperationPolicyReqItCase extends AbstractItCase { yaml = yaml.replaceAll("trigger_policy: (.*)", "trigger_policy: "); yaml = yaml.replaceAll("id: (.*)", "id: "); yaml = yaml.replaceAll("success: (.*)", "success: "); + // Remove this field as not always present (depends of policy api) + yaml = yaml.replaceAll(" pnf: null", ""); + yaml = yaml.substring(yaml.indexOf("controlLoop:"), yaml.length()); assertEquals(ResourceFileUtil.getResourceAsString("example/operational-policy/yaml-policy-chain-2.yaml"), yaml); } -- cgit 1.2.3-korg