Commit 05cf8229 authored by Madhura Bhave's avatar Madhura Bhave

Fix tests

parent c937bb68
...@@ -29,11 +29,13 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; ...@@ -29,11 +29,13 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration; import org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient;
import org.springframework.web.servlet.DispatcherServlet;
/** /**
* Integration tests for the Jersey actuator endpoints. * Integration tests for the Jersey actuator endpoints.
...@@ -44,8 +46,11 @@ public class JerseyEndpointIntegrationTests { ...@@ -44,8 +46,11 @@ public class JerseyEndpointIntegrationTests {
@Test @Test
public void linksAreProvidedToAllEndpointTypes() throws Exception { public void linksAreProvidedToAllEndpointTypes() throws Exception {
FilteredClassLoader classLoader = new FilteredClassLoader(
DispatcherServlet.class);
new WebApplicationContextRunner( new WebApplicationContextRunner(
AnnotationConfigServletWebServerApplicationContext::new) AnnotationConfigServletWebServerApplicationContext::new)
.withClassLoader(classLoader)
.withConfiguration( .withConfiguration(
AutoConfigurations.of(JacksonAutoConfiguration.class, AutoConfigurations.of(JacksonAutoConfiguration.class,
JerseyAutoConfiguration.class, JerseyAutoConfiguration.class,
......
...@@ -30,6 +30,7 @@ import org.springframework.boot.actuate.endpoint.web.PathMapper; ...@@ -30,6 +30,7 @@ import org.springframework.boot.actuate.endpoint.web.PathMapper;
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer; import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer;
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier; import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
...@@ -50,6 +51,7 @@ public class JolokiaEndpointAutoConfigurationTests { ...@@ -50,6 +51,7 @@ public class JolokiaEndpointAutoConfigurationTests {
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of( .withConfiguration(AutoConfigurations.of(
DispatcherServletAutoConfiguration.class,
ManagementContextAutoConfiguration.class, ManagementContextAutoConfiguration.class,
ServletManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class,
ServletEndpointManagementContextConfiguration.class, ServletEndpointManagementContextConfiguration.class,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment