From 9fc1339798fb5346595a7d16e4f550a9fe65e52a Mon Sep 17 00:00:00 2001 From: Mateusz Chrzonstowski Date: Thu, 11 Jul 2024 13:29:44 +0200 Subject: [PATCH] fix: Narrow scanning, skip using "var" --- .../src/main/java/examples/EmbedMe.java | 4 +--- .../src/test/java/examples/EmbedMeTest.java | 12 ++++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/embedded/ee10-servlet-server/src/main/java/examples/EmbedMe.java b/embedded/ee10-servlet-server/src/main/java/examples/EmbedMe.java index 4f8c95a..5cf48df 100755 --- a/embedded/ee10-servlet-server/src/main/java/examples/EmbedMe.java +++ b/embedded/ee10-servlet-server/src/main/java/examples/EmbedMe.java @@ -13,13 +13,11 @@ package examples; -import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.stream.Stream; import org.eclipse.jetty.server.Server; @@ -51,7 +49,7 @@ public static Server newServer(int port) context.setBaseResource(baseResource); context.setContextPath("/"); context.setWelcomeFiles(new String[]{"index.html", "welcome.html"}); - context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", ".*/"); + context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", ".*/classes/*"); context.setParentLoaderPriority(true); server.setHandler(context); return server; diff --git a/embedded/ee10-servlet-server/src/test/java/examples/EmbedMeTest.java b/embedded/ee10-servlet-server/src/test/java/examples/EmbedMeTest.java index c9c7aa6..869f066 100644 --- a/embedded/ee10-servlet-server/src/test/java/examples/EmbedMeTest.java +++ b/embedded/ee10-servlet-server/src/test/java/examples/EmbedMeTest.java @@ -29,25 +29,25 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; -public class EmbedMeTest +class EmbedMeTest { private Server server; @BeforeEach - public void startServer() throws Exception + void startServer() throws Exception { server = EmbedMe.newServer(0); server.start(); } @AfterEach - public void stopServer() + void stopServer() { LifeCycle.stop(server); } @Test - public void testGetWelcome() throws IOException, InterruptedException + void testGetWelcome() throws IOException, InterruptedException { HttpClient client = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); HttpRequest request = HttpRequest.newBuilder() @@ -61,8 +61,8 @@ public void testGetWelcome() throws IOException, InterruptedException @Test void testGetIndex() throws IOException, InterruptedException { - var client = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); - var request = HttpRequest.newBuilder() + HttpClient client = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); + HttpRequest request = HttpRequest.newBuilder() .uri(server.getURI().resolve("/test")) .GET() .build();