mirror of
https://github.com/tiennm99/tjahzi.git
synced 2026-10-20 00:15:48 +00:00
Added clear error message when test resource was missing.
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user