diff --git a/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/ServletContainerInitializerTestCase.java b/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/ServletContainerInitializerTestCase.java index 7460719ec0ee5..2487a0a693f83 100644 --- a/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/ServletContainerInitializerTestCase.java +++ b/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/ServletContainerInitializerTestCase.java @@ -4,6 +4,7 @@ import jakarta.servlet.ServletContainerInitializer; +import org.jboss.shrinkwrap.api.asset.StringAsset; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -16,6 +17,7 @@ public class ServletContainerInitializerTestCase { static QuarkusUnitTest runner = new QuarkusUnitTest() .withApplicationRoot((jar) -> jar .addAsServiceProvider(ServletContainerInitializer.class, TestSCI.class) + .addAsResource(new StringAsset("index.html"), "META-INF/resources/index.html") .addClasses(SCIInterface.class, SCIImplementation.class, TestSCI.class, SCIAnnotation.class, AnnotatedSCIClass.class)); @@ -27,4 +29,4 @@ public void testSci() { containsString("io.quarkus.undertow.test.AnnotatedSCIClass")); } -} +} \ No newline at end of file diff --git a/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/TestSCI.java b/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/TestSCI.java index b1c44663b3b65..565fc708232c3 100644 --- a/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/TestSCI.java +++ b/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/TestSCI.java @@ -12,8 +12,13 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import org.jboss.logging.Logger; + @HandlesTypes({ SCIInterface.class, SCIAnnotation.class }) public class TestSCI implements ServletContainerInitializer { + + private static final Logger log = Logger.getLogger(TestSCI.class); + @Override public void onStartup(Set> c, ServletContext ctx) throws ServletException { ServletRegistration.Dynamic info = ctx.addServlet("test", new HttpServlet() { @@ -25,5 +30,16 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se } }); info.addMapping("/sci"); + + log.info("Checking servlet resource paths..."); + + Set resourcePaths = ctx.getResourcePaths("/"); + for (String resourcePath : resourcePaths) { + log.info("Resource: " + resourcePath); + } + + if (resourcePaths.isEmpty()) { + throw new RuntimeException("NO servlet resource paths found!"); + } } -} +} \ No newline at end of file