diff --git a/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java b/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java index 96cf5e2ff..935045a84 100644 --- a/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -553,6 +553,7 @@ protected ServletContext createWebServer() throws Exception { context.setClassLoader(getClass().getClassLoader()); context.setConfigurations(new Configuration[]{new WebXmlConfiguration()}); context.addBean(new NoListenerConfiguration(context)); + context.setServer(server); server.setHandler(context); JettyWebSocketServletContainerInitializer.configure(context, null); context.getSecurityHandler().setLoginService(configureUserRealm()); diff --git a/src/main/java/org/jvnet/hudson/test/JenkinsRule.java b/src/main/java/org/jvnet/hudson/test/JenkinsRule.java index f705a4d33..40d318630 100644 --- a/src/main/java/org/jvnet/hudson/test/JenkinsRule.java +++ b/src/main/java/org/jvnet/hudson/test/JenkinsRule.java @@ -859,6 +859,7 @@ public static Server _createWebServer( context.setClassLoader(classLoader); context.setConfigurations(new Configuration[]{new WebXmlConfiguration()}); context.addBean(new NoListenerConfiguration(context)); + context.setServer(server); server.setHandler(context); JettyWebSocketServletContainerInitializer.configure(context, null); context.getSecurityHandler().setLoginService(loginServiceSupplier.get());