Added clear error message when test resource was missing.

This commit is contained in:
tomasz.kowalczewski committed 2021-10-20 23:42:05 +02:00
1 parent e073d52d53
commit 50a7c7f5ac
1 file changed
+9 -2
@@ -12,6 +12,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
@Testcontainers
public class IntegrationTest {
@@ -37,9 +38,15 @@ public class IntegrationTest {
public static LoggerContext loadConfig(String fileName) {
try {
URI uri = IntegrationTest.class
URL resource = IntegrationTest.class
.getClassLoader()
.getResource(fileName)
.getResource(fileName);
if (resource == null) {
Assertions.fail("Resource " + fileName + " not found");
}
URI uri = resource
.toURI();
return loadConfig(uri);