diff --git a/apm-agent-plugin-sdk/src/test/java/co/elastic/apm/agent/sdk/bytebuddy/CustomElementMatchersTest.java b/apm-agent-plugin-sdk/src/test/java/co/elastic/apm/agent/sdk/bytebuddy/CustomElementMatchersTest.java index 6f24e36a8c..20398a47bd 100644 --- a/apm-agent-plugin-sdk/src/test/java/co/elastic/apm/agent/sdk/bytebuddy/CustomElementMatchersTest.java +++ b/apm-agent-plugin-sdk/src/test/java/co/elastic/apm/agent/sdk/bytebuddy/CustomElementMatchersTest.java @@ -26,13 +26,13 @@ import java.io.File; import java.io.IOException; import java.net.MalformedURLException; +import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.URLClassLoader; -import java.net.URI; -import java.nio.file.Files; import java.nio.file.FileSystem; import java.nio.file.FileSystems; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.CodeSigner; @@ -42,7 +42,12 @@ import java.util.List; import java.util.Map; -import static co.elastic.apm.agent.sdk.bytebuddy.CustomElementMatchers.*; +import static co.elastic.apm.agent.sdk.bytebuddy.CustomElementMatchers.classLoaderCanLoadClass; +import static co.elastic.apm.agent.sdk.bytebuddy.CustomElementMatchers.implementationVersionGte; +import static co.elastic.apm.agent.sdk.bytebuddy.CustomElementMatchers.implementationVersionLte; +import static co.elastic.apm.agent.sdk.bytebuddy.CustomElementMatchers.isAgentClassLoader; +import static co.elastic.apm.agent.sdk.bytebuddy.CustomElementMatchers.isInAnyPackage; +import static co.elastic.apm.agent.sdk.bytebuddy.CustomElementMatchers.isInternalPluginClassLoader; import static net.bytebuddy.matcher.ElementMatchers.none; import static org.assertj.core.api.Assertions.assertThat; @@ -84,7 +89,7 @@ void testSemVerFallbackOnMavenProperties(@TempDir Path tempDir) throws URISyntax Map fsProperties = new HashMap<>(); fsProperties.put("create", "false"); - URI fsUri = URI.create("jar:file://" + modifiedJar.toAbsolutePath()); + URI fsUri = URI.create("jar:" + modifiedJar.toUri()); try (FileSystem zipFs = FileSystems.newFileSystem(fsUri, fsProperties)) { Files.delete(zipFs.getPath("META-INF", "MANIFEST.MF")); }