Skip to content

Commit 6c0518f

Browse files
committed
Fix ExceptionSerializationTests to use getCodeSource instead of getResource
1 parent a7e45e3 commit 6c0518f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
218218
};
219219

220220
Files.walkFileTree(startPath, visitor);
221-
final Path testStartPath = PathUtils.get(ExceptionSerializationTests.class.getResource(path).toURI());
221+
final Path testStartPath = PathUtils.get(
222+
ElasticsearchExceptionTests.class.getProtectionDomain().getCodeSource().getLocation().toURI()
223+
).resolve("org").resolve("elasticsearch");
222224
Files.walkFileTree(testStartPath, visitor);
223225
assertTrue(notRegistered.remove(TestException.class));
224226
assertTrue(notRegistered.remove(UnknownHeaderException.class));

0 commit comments

Comments
 (0)