summaryrefslogtreecommitdiffstats
path: root/aai-core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'aai-core/src/test')
-rw-r--r--aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java
index 287761e6..87f52eb2 100644
--- a/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java
+++ b/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java
@@ -28,8 +28,8 @@ import org.apache.tinkerpop.gremlin.structure.Direction;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
-
import org.openecomp.aai.exceptions.AAIException;
+import org.openecomp.aai.introspection.Version;
import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException;
@Ignore
@@ -87,4 +87,17 @@ public class EdgeRulesTest {
Map<String, EdgeRule> ruleMap = rules.getEdgeRules("availability-zone", "complex");
assertEquals("has groupsResourcesIn rule", "groupsResourcesIn", ruleMap.get("groupsResourcesIn").getLabel());
}
+
+ @Test
+ public void verifyOldEdgeRule() throws AAIException, ClassNotFoundException, IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
+ assertEquals(true, EdgeRules.getInstance().hasEdgeRule("model-element", "model-ver"));
+ assertEquals(true, EdgeRules.getInstance(Version.v8).hasEdgeRule("pserver", "complex"));
+ assertEquals(false, EdgeRules.getInstance(Version.v8).hasEdgeRule("model-element", "model-ver"));
+ }
+
+ @Test
+ public void verifyOldEdgeDeleteSemantics() throws AAIException, ClassNotFoundException, IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
+ assertEquals(DeleteSemantic.ERROR_4_IN_EDGES_OR_CASCADE, EdgeRules.getInstance().getDeleteSemantic("model"));
+ assertEquals(DeleteSemantic.CASCADE_TO_CHILDREN, EdgeRules.getInstance(Version.v8).getDeleteSemantic("model"));
+ }
}