aboutsummaryrefslogtreecommitdiffstats
path: root/models-tosca/src/test/java/org
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-05-02 16:53:57 +0000
committerliamfallon <liam.fallon@est.tech>2019-05-02 16:53:57 +0000
commit41ce3cd080630e0206478c34d39eac1e4d1fc09d (patch)
treee6a9c32918f9681ccdeadb2c805624ed3f8b107a /models-tosca/src/test/java/org
parentf469cc7dd370df6d3f25db79a62d47b1ae01b2c9 (diff)
Fix bug in guard policy metadata creation
Issue-ID: POLICY-1728 Change-Id: Ie33a30a811fcd8c128dfac87c17dcb37da6d42b4 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-tosca/src/test/java/org')
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapperTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapperTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapperTest.java
index b1dac8f20..f2fb53d60 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapperTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapperTest.java
@@ -22,6 +22,8 @@ package org.onap.policy.models.tosca.legacy.mapping;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import java.util.LinkedHashMap;
+
import org.junit.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicies;
@@ -47,6 +49,11 @@ public class LegacyGuardPolicyMapperTest {
assertThatThrownBy(() -> {
new LegacyGuardPolicyMapper().fromToscaServiceTemplate(serviceTemplate);
+ }).hasMessageContaining("no metadata defined on TOSCA policy");
+
+ policy.setMetadata(new LinkedHashMap<>());
+ assertThatThrownBy(() -> {
+ new LegacyGuardPolicyMapper().fromToscaServiceTemplate(serviceTemplate);
}).hasMessageContaining("no properties defined on TOSCA policy");
}
}