summaryrefslogtreecommitdiffstats
path: root/aai-core
diff options
context:
space:
mode:
Diffstat (limited to 'aai-core')
-rw-r--r--aai-core/pom.xml10
-rw-r--r--aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java12
-rw-r--r--aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java40
3 files changed, 60 insertions, 2 deletions
diff --git a/aai-core/pom.xml b/aai-core/pom.xml
index c696d7c7..57b67e67 100644
--- a/aai-core/pom.xml
+++ b/aai-core/pom.xml
@@ -27,11 +27,11 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-common</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<artifactId>aai-core</artifactId>
<name>aai-core</name>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<sonar.language>java</sonar.language>
@@ -987,6 +987,12 @@
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-groovy</artifactId>
<version>${gremlin.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
diff --git a/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java b/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java
index 52319709..5915ce68 100644
--- a/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java
+++ b/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java
@@ -31,6 +31,8 @@ import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.Matchers.matchesPattern;
import static org.junit.Assert.*;
+import java.io.FileNotFoundException;
+
public class AAIGraphTest extends AAISetup{
@Before
public void setup() {
@@ -68,5 +70,15 @@ public class AAIGraphTest extends AAISetup{
graphMgt.rollback();
graph.close();
}
+
+ @Test (expected=FileNotFoundException.class)
+ public void JanusGraphOpenNameWithInvalidFilePathTest() throws Exception{
+ JanusGraph graph = JanusGraphFactory.open(new AAIGraphConfig.Builder("invalid").forService(SERVICE_NAME).withGraphType("graphType").buildConfiguration());
+ JanusGraphManagement graphMgt = graph.openManagement();
+ String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get();
+ assertThat(connectionInstanceName,matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_graphType_\\d+\\(current\\)$"));
+ graphMgt.rollback();
+ graph.close();
+ }
}
diff --git a/aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java b/aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java
new file mode 100644
index 00000000..c25e2929
--- /dev/null
+++ b/aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java
@@ -0,0 +1,40 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.rest;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class RestHandlerTest {
+
+ @Test
+ public void testGetInstance() {
+
+ RestHandlerService firstInstance = RestHandlerService.getInstance();
+ RestHandlerService secondInstance = RestHandlerService.getInstance();
+ assertNotNull(firstInstance);
+ assertNotNull(secondInstance);
+ assertTrue(firstInstance == secondInstance);
+
+ }
+}