summaryrefslogtreecommitdiffstats
path: root/aai-core
diff options
context:
space:
mode:
authorJames Forsyth <jf2512@att.com>2018-10-13 00:34:22 +0000
committerGerrit Code Review <gerrit@onap.org>2018-10-13 00:34:22 +0000
commit4843d76e54fc50882ca1bc7c3cc8ff11544ad122 (patch)
tree43df0ec4bcd741db0afee9aeaa0b2fb6fe5811d4 /aai-core
parent2470b451f74cb511a6939c443193ce644424b055 (diff)
parent41e8fc46aa4611d893f196c004eea2942a1f7083 (diff)
Merge "exception scenario covered in AAIGraphTest.java"
Diffstat (limited to 'aai-core')
-rw-r--r--aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java12
1 files changed, 12 insertions, 0 deletions
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();
+ }
}