diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu2IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu2IT.java index e1aeb5f..28acdfc 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu2IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu2IT.java @@ -15,6 +15,7 @@ import org.junit.Test; import java.io.File; import java.io.IOException; +import java.nio.file.Paths; import static org.junit.Assert.assertEquals; @@ -56,13 +57,7 @@ public class ExampleServerDstu2IT { @BeforeClass public static void beforeClass() throws Exception { - /* - * This runs under maven, and I'm not sure how else to figure out the target directory from code.. - */ - String path = ExampleServerDstu2IT.class.getClassLoader().getResource(".keep_hapi-fhir-jpaserver-starter").getPath(); - path = new File(path).getParent(); - path = new File(path).getParent(); - path = new File(path).getParent(); + String path = Paths.get("").toAbsolutePath().toString(); ourLog.info("Project base path is: {}", path); diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java index 43a5b89..577f30e 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java @@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals; import java.io.File; import java.io.IOException; +import java.nio.file.Paths; import ca.uhn.fhir.util.PortUtil; import org.eclipse.jetty.server.Server; @@ -55,13 +56,7 @@ public class ExampleServerDstu3IT { @BeforeClass public static void beforeClass() throws Exception { - /* - * This runs under maven, and I'm not sure how else to figure out the target directory from code.. - */ - String path = ExampleServerDstu3IT.class.getClassLoader().getResource(".keep_hapi-fhir-jpaserver-starter").getPath(); - path = new File(path).getParent(); - path = new File(path).getParent(); - path = new File(path).getParent(); + String path = Paths.get("").toAbsolutePath().toString(); ourLog.info("Project base path is: {}", path); diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java index bccdd20..4f66d28 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java @@ -15,6 +15,7 @@ import org.junit.Test; import java.io.File; import java.io.IOException; +import java.nio.file.Paths; import static org.junit.Assert.assertEquals; @@ -56,13 +57,7 @@ public class ExampleServerR4IT { @BeforeClass public static void beforeClass() throws Exception { - /* - * This runs under maven, and I'm not sure how else to figure out the target directory from code.. - */ - String path = ExampleServerR4IT.class.getClassLoader().getResource(".keep_hapi-fhir-jpaserver-starter").getPath(); - path = new File(path).getParent(); - path = new File(path).getParent(); - path = new File(path).getParent(); + String path = Paths.get("").toAbsolutePath().toString(); ourLog.info("Project base path is: {}", path); diff --git a/src/test/resources/.keep_hapi-fhir-jpaserver-starter b/src/test/resources/.keep_hapi-fhir-jpaserver-starter deleted file mode 100644 index e69de29..0000000