summaryrefslogtreecommitdiffstats
path: root/aai-schema-abstraction/src/test/java
diff options
context:
space:
mode:
authorJimmy Forsyth <jf2512@att.com>2020-03-10 15:21:02 -0400
committerJimmy Forsyth <jf2512@att.com>2020-03-10 16:34:50 -0400
commited992e01c17d5677dfa0e1d0a76a7f9bc12c2a90 (patch)
tree085e36cce2b19afbde50139f34eb969001db91cd /aai-schema-abstraction/src/test/java
parent2f4601f2b8fa2e219e870bfabe8d1c464e67dd69 (diff)
Reenable spring-boot2 in aai-common
Issue-ID: AAI-2831 Signed-off-by: Jimmy Forsyth <jf2512@att.com> Change-Id: I9f3f1d8d1d9ef45786d0f17afa5c824e90c77263
Diffstat (limited to 'aai-schema-abstraction/src/test/java')
-rw-r--r--aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java68
1 files changed, 34 insertions, 34 deletions
diff --git a/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java b/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java
index 6c7364ae..6cfb5a7d 100644
--- a/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java
+++ b/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java
@@ -30,14 +30,14 @@ import java.util.Set;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.runners.MockitoJUnitRunner;
import org.onap.aai.schemaif.SchemaProviderException;
import org.onap.aai.schemaif.definitions.EdgeSchema;
import org.onap.aai.schemaif.definitions.PropertySchema;
import org.onap.aai.schemaif.definitions.VertexSchema;
import org.onap.aai.schemaif.definitions.types.DataType.Type;
-@RunWith(MockitoJUnitRunner.Silent.class)
+@RunWith(MockitoJUnitRunner.class)
public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
@Test
@@ -49,15 +49,15 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
VertexSchema vertSchema = schemaProvider.getVertexSchema("pserver", schemaProvider.getLatestSchemaVersion());
System.out.println(vertSchema.toString());
- EdgeSchema edgeSchema = schemaProvider.getEdgeSchema("org.onap.relationships.inventory.LocatedIn",
+ EdgeSchema edgeSchema = schemaProvider.getEdgeSchema("org.onap.relationships.inventory.LocatedIn",
"cloud-region", "zone", schemaProvider.getLatestSchemaVersion());
System.out.println(edgeSchema.toString());
-
+
// Validate vertex schema
assertTrue(vertSchema.getName().equals("pserver"));
assertTrue(vertSchema.getAnnotationValue("nameProps").equals("pserver-name2"));
assertTrue(vertSchema.getAnnotationValue("dependentOn") == null);
-
+
PropertySchema propSchema = vertSchema.getPropertySchema("hostname");
assertTrue(propSchema.getName().equals("hostname"));
assertTrue(propSchema.getDefaultValue().equals(""));
@@ -66,7 +66,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(propSchema.getDataType().getType().compareTo(Type.STRING) == 0);
Object obj = propSchema.validateValue("somestring");
assertTrue(obj instanceof String);
-
+
propSchema = vertSchema.getPropertySchema("in-maint");
assertTrue(propSchema.getName().equals("in-maint"));
assertTrue(propSchema.getDefaultValue().equals("false"));
@@ -79,8 +79,8 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
obj = propSchema.validateValue("false");
assertTrue(obj instanceof Boolean);
assertTrue(propSchema.getDataType().validateValue("badValue") == null);
-
-
+
+
propSchema = vertSchema.getPropertySchema("aai-node-type");
assertTrue(propSchema.getName().equals("aai-node-type"));
assertTrue(propSchema.getDefaultValue().equals(""));
@@ -88,7 +88,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(!propSchema.isKey());
assertTrue(propSchema.isReserved());
assertTrue(propSchema.getDataType().getType().compareTo(Type.STRING) == 0);
-
+
propSchema = vertSchema.getPropertySchema("pserver-id");
assertTrue(propSchema.getName().equals("pserver-id"));
assertTrue(propSchema.getDefaultValue().equals(""));
@@ -96,7 +96,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(!propSchema.isReserved());
assertTrue(propSchema.isKey());
assertTrue(propSchema.getDataType().getType().compareTo(Type.STRING) == 0);
-
+
propSchema = vertSchema.getPropertySchema("number-of-cpus");
assertTrue(propSchema.getName().equals("number-of-cpus"));
assertTrue(propSchema.getAnnotationValue("source-of-truth-type").equals("openstack"));
@@ -107,7 +107,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(obj instanceof Integer);
assertTrue(propSchema.getDataType().validateValue("5.5") == null);
assertTrue(propSchema.getDataType().validateValue("xyz") == null);
-
+
// Validate edge schema
assertTrue(edgeSchema.getName().equals("org.onap.relationships.inventory.LocatedIn"));
assertTrue(edgeSchema.getSource().equals("cloud-region"));
@@ -115,7 +115,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(edgeSchema.getMultiplicity().equals(EdgeSchema.Multiplicity.MANY_2_ONE));
assertTrue(edgeSchema.getAnnotationValue("contains-other-v").equals("NONE"));
assertTrue(edgeSchema.getPropertySchema("prevent-delete").getDataType().getType().equals(Type.STRING));
-
+
// Validate 'dependentOn' annotation
vertSchema = schemaProvider.getVertexSchema("tenant", schemaProvider.getLatestSchemaVersion());
assertTrue(vertSchema.getAnnotationValue("dependentOn").equals("cloud-region"));
@@ -128,19 +128,19 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(false);
}
}
-
+
@Test
public void testAdjacentEdges() throws SchemaProviderException {
try {
OxmSchemaProvider schemaProvider = new OxmSchemaProvider();
schemaProvider.loadSchema();
- Set<EdgeSchema> edgeSchemaList =
+ Set<EdgeSchema> edgeSchemaList =
schemaProvider.getAdjacentEdgeSchema("snapshot", schemaProvider.getLatestSchemaVersion());
-
+
// Validate edge schema
assertTrue(edgeSchemaList.size() == 2);
-
+
for (EdgeSchema es : edgeSchemaList) {
System.out.println(es.toString());
if (es.getName().equals("org.onap.relationships.inventory.BelongsTo")) {
@@ -166,15 +166,15 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(false);
}
}
-
+
@Test
public void testValidSourceTargetEdge() throws SchemaProviderException {
try {
OxmSchemaProvider schemaProvider = new OxmSchemaProvider();
schemaProvider.loadSchema();
- Set<EdgeSchema> edgeSchemaList =
- schemaProvider.getEdgeSchemaForSourceTarget("service-instance", "customer",
+ Set<EdgeSchema> edgeSchemaList =
+ schemaProvider.getEdgeSchemaForSourceTarget("service-instance", "customer",
schemaProvider.getLatestSchemaVersion());
// Validate edge schema
@@ -183,14 +183,14 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(edgeSchemaList.iterator().next().getSource().equals("service-instance"));
assertTrue(edgeSchemaList.iterator().next().getTarget().equals("customer"));
assertTrue(edgeSchemaList.iterator().next().getMultiplicity().equals(EdgeSchema.Multiplicity.MANY_2_MANY));
-
- edgeSchemaList =
- schemaProvider.getEdgeSchemaForSourceTarget("cloud-region", "complex",
+
+ edgeSchemaList =
+ schemaProvider.getEdgeSchemaForSourceTarget("cloud-region", "complex",
schemaProvider.getLatestSchemaVersion());
-
+
// Validate edge schema
assertTrue(edgeSchemaList.size() == 2);
-
+
for (EdgeSchema es : edgeSchemaList) {
System.out.println(es.toString());
if (es.getName().equals("org.onap.relationships.inventory.FoundIn")) {
@@ -207,11 +207,11 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(false);
}
}
-
- edgeSchemaList =
- schemaProvider.getEdgeSchemaForSourceTarget("cloud-region", "bad-node",
+
+ edgeSchemaList =
+ schemaProvider.getEdgeSchemaForSourceTarget("cloud-region", "bad-node",
schemaProvider.getLatestSchemaVersion());
-
+
// Validate edge schema
assertTrue(edgeSchemaList.size() == 0);
}
@@ -223,23 +223,23 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup {
assertTrue(false);
}
}
-
+
@Test
public void testInvalidVertexOrEdge() throws SchemaProviderException {
try {
OxmSchemaProvider schemaProvider = new OxmSchemaProvider();
schemaProvider.loadSchema();
- VertexSchema vertSchema =
+ VertexSchema vertSchema =
schemaProvider.getVertexSchema("bad-node", schemaProvider.getLatestSchemaVersion());
assertTrue(vertSchema == null);
- EdgeSchema edgeSchema = schemaProvider.getEdgeSchema("org.onap.relationships.inventory.LocatedIn",
+ EdgeSchema edgeSchema = schemaProvider.getEdgeSchema("org.onap.relationships.inventory.LocatedIn",
"cloud-region", "bad-node", schemaProvider.getLatestSchemaVersion());
assertTrue(edgeSchema == null);
-
- Set<EdgeSchema> edgeSchemaList =
- schemaProvider.getAdjacentEdgeSchema("org.onap.nodes.bad-node",
+
+ Set<EdgeSchema> edgeSchemaList =
+ schemaProvider.getAdjacentEdgeSchema("org.onap.nodes.bad-node",
schemaProvider.getLatestSchemaVersion());
assertTrue(edgeSchemaList.isEmpty());
}