aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java')
-rw-r--r--src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java b/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java
index 4e6590d..feeb1c4 100644
--- a/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java
+++ b/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java
@@ -23,7 +23,8 @@ package org.onap.schema;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
-import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@@ -34,10 +35,10 @@ import org.onap.crud.exception.CrudException;
public class RelationshipSchemaLoaderTest {
@Before
- public void init() {
- ClassLoader classLoader = getClass().getClassLoader();
- File dir = new File(classLoader.getResource( "model").getFile());
- System.setProperty("CONFIG_HOME", dir.getParent());
+ public void init() throws Exception {
+ Path resourcePath = Paths.get(ClassLoader.getSystemResource("model").toURI());
+ Path parentPath = resourcePath.getParent();
+ System.setProperty("CONFIG_HOME", parentPath.toString());
RelationshipSchemaLoader.resetVersionContextMap();
}