aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-09-17 15:38:14 +0200
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-09-17 16:37:11 +0200
commit610846c7e9e48806073e15ede8e502119c587ca3 (patch)
treeee1333498bce3f6c7210e71748812bbd8d86bdd9 /src/test/java
parent1bdae1172660c1c05c09c800d49ff8f46a4ccb72 (diff)
Update aai-common to 1.14.6 in graphadmin
- upgrade spring-boot (2.4.13 -> 2.5.15) - fix vulnerabilities - bump snapshot version to 1.14.7-SNAPSHOT Issue-ID: AAI-3994 Change-Id: Ie692eeb20d0a7e1e0d579134b109d0c2ecfd7840 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/aai/schema/db/ManageSchemaTest.java43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/test/java/org/onap/aai/schema/db/ManageSchemaTest.java b/src/test/java/org/onap/aai/schema/db/ManageSchemaTest.java
index 55af4f9..23c3352 100644
--- a/src/test/java/org/onap/aai/schema/db/ManageSchemaTest.java
+++ b/src/test/java/org/onap/aai/schema/db/ManageSchemaTest.java
@@ -20,8 +20,6 @@
package org.onap.aai.schema.db;
import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
import org.janusgraph.core.JanusGraph;
import org.janusgraph.core.JanusGraphFactory;
import org.janusgraph.core.schema.JanusGraphManagement;
@@ -33,6 +31,9 @@ import org.onap.aai.AAISetup;
import org.onap.aai.db.schema.DBIndex;
import org.onap.aai.db.schema.ManageJanusGraphSchema;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
import java.io.IOException;
import java.util.Set;
@@ -45,14 +46,14 @@ public class ManageSchemaTest extends AAISetup {
public void beforeTest() {
graph = JanusGraphFactory.open("bundleconfig-local/etc/appprops/aaiconfig.properties");
}
-
+
/*
@Test
public void populateEmptyGraph() {
ManageJanusGraphSchema schema = new ManageJanusGraphSchema(graph);
schema.buildSchema();
}
-
+
@Test
public void modifyIndex() {
ManageJanusGraphSchema schema = new ManageJanusGraphSchema(graph);
@@ -66,37 +67,37 @@ public class ManageSchemaTest extends AAISetup {
index.setName("internet-topology");
index.setUnique(false);
schema.updateIndex(index);
-
+
}
*/
@Test
public void closeRunningInstances() {
-
+
JanusGraphManagement mgmt = graph.openManagement();
Set<String> instances = mgmt.getOpenInstances();
-
+
for (String instance : instances) {
-
+
if (!instance.contains("(current)")) {
mgmt.forceCloseInstance(instance);
}
}
mgmt.commit();
-
+
graph.close();
-
+
}
@Test
public void addNewIndex() throws JsonParseException, JsonMappingException, IOException {
ObjectMapper mapper = new ObjectMapper();
- String content = " {\r\n" +
- " \"name\" : \"equipment-name\",\r\n" +
- " \"unique\" : false,\r\n" +
- " \"properties\" : [ {\r\n" +
- " \"name\" : \"equipment-name\",\r\n" +
- " \"cardinality\" : \"SINGLE\",\r\n" +
- " \"typeClass\" : \"java.lang.String\"\r\n" +
- " } ]\r\n" +
+ String content = " {\r\n" +
+ " \"name\" : \"equipment-name\",\r\n" +
+ " \"unique\" : false,\r\n" +
+ " \"properties\" : [ {\r\n" +
+ " \"name\" : \"equipment-name\",\r\n" +
+ " \"cardinality\" : \"SINGLE\",\r\n" +
+ " \"typeClass\" : \"java.lang.String\"\r\n" +
+ " } ]\r\n" +
" }";
DBIndex index = mapper.readValue(content, DBIndex.class);
ManageJanusGraphSchema schema = new ManageJanusGraphSchema(graph, auditorFactory, schemaVersions, edgeIngestor);
@@ -104,9 +105,9 @@ public class ManageSchemaTest extends AAISetup {
Set<String> instances = mgmt.getOpenInstances();
System.out.println(instances);
schema.updateIndex(index);
-
+
graph.close();
-
+
}
-
+
}