|
35 | 35 | import org.springframework.boot.actuate.endpoint.web.EndpointServlet;
|
36 | 36 | import org.springframework.boot.actuate.endpoint.web.annotation.RestControllerEndpoint;
|
37 | 37 | import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpoint;
|
| 38 | +import org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository; |
38 | 39 | import org.springframework.boot.autoconfigure.AutoConfigurations;
|
39 | 40 | import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
|
40 | 41 | import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
|
|
45 | 46 | import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
46 | 47 | import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
|
47 | 48 | import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
|
| 49 | +import org.springframework.context.annotation.Bean; |
| 50 | +import org.springframework.context.annotation.Configuration; |
48 | 51 | import org.springframework.http.HttpMethod;
|
49 | 52 | import org.springframework.http.HttpStatus;
|
50 | 53 | import org.springframework.test.web.reactive.server.EntityExchangeResult;
|
@@ -79,7 +82,8 @@ public class WebMvcEndpointExposureIntegrationTests {
|
79 | 82 | .withConfiguration(
|
80 | 83 | AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL))
|
81 | 84 | .withUserConfiguration(CustomMvcEndpoint.class,
|
82 |
| - CustomServletEndpoint.class) |
| 85 | + CustomServletEndpoint.class, |
| 86 | + HttpTraceRepositoryConfiguration.class) |
83 | 87 | .withPropertyValues("server.port:0");
|
84 | 88 |
|
85 | 89 | @Test
|
@@ -215,4 +219,14 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
|
215 | 219 |
|
216 | 220 | }
|
217 | 221 |
|
| 222 | + @Configuration(proxyBeanMethods = false) |
| 223 | + public static class HttpTraceRepositoryConfiguration { |
| 224 | + |
| 225 | + @Bean |
| 226 | + public InMemoryHttpTraceRepository httpTraceRepository() { |
| 227 | + return new InMemoryHttpTraceRepository(); |
| 228 | + } |
| 229 | + |
| 230 | + } |
| 231 | + |
218 | 232 | }
|
0 commit comments