summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-10-06 14:09:17 +0200
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-10-06 14:09:17 +0200
commitdcaebd45961cba194af8b3306d8216851ac27a86 (patch)
tree79fa39d2b5d2e1d9122143445f0cf327dfdc5a99 /src
parent9157c0834b771964597da1f2a259b737fc86e1f7 (diff)
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) <sd378r@intl.att.com>
Diffstat (limited to 'src')
-rw-r--r--src/test/java/org/onap/clamp/clds/it/OperationPolicyReqItCase.java6
-rw-r--r--src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml2
-rw-r--r--src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml2
3 files changed, 6 insertions, 4 deletions
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 c7084b64f..8fba5736d 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: <generatedId>");
yaml = yaml.replaceAll("id: (.*)", "id: <generatedId>");
yaml = yaml.replaceAll("success: (.*)", "success: <generatedId>");
+ // 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: <generatedId>");
yaml = yaml.replaceAll("id: (.*)", "id: <generatedId>");
yaml = yaml.replaceAll("success: (.*)", "success: <generatedId>");
+ // 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);
}
diff --git a/src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml b/src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml
index 80b9b7ca9..afe9fdd8e 100644
--- a/src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml
+++ b/src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml
@@ -1,8 +1,6 @@
-!!org.onap.policy.controlloop.policy.ControlLoopPolicy
controlLoop:
abatement: false
controlLoopName: controlNameTest
- pnf: null
resources:
- resourceInvariantUUID: null
resourceName: 6c7aaec2-59eb-41d9-8681-b7f976ab668d
diff --git a/src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml b/src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml
index 80b9b7ca9..afe9fdd8e 100644
--- a/src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml
+++ b/src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml
@@ -1,8 +1,6 @@
-!!org.onap.policy.controlloop.policy.ControlLoopPolicy
controlLoop:
abatement: false
controlLoopName: controlNameTest
- pnf: null
resources:
- resourceInvariantUUID: null
resourceName: 6c7aaec2-59eb-41d9-8681-b7f976ab668d