use of org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes in project spring-boot by spring-projects.
the class CloudFoundryWebEndpointDiscovererTests method load.
private void load(Function<EndpointId, Long> timeToLive, PathMapper endpointPathMapper, Class<?> configuration, Consumer<CloudFoundryWebEndpointDiscoverer> consumer) {
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(configuration)) {
ConversionServiceParameterValueMapper parameterMapper = new ConversionServiceParameterValueMapper(DefaultConversionService.getSharedInstance());
EndpointMediaTypes mediaTypes = new EndpointMediaTypes(Collections.singletonList("application/json"), Collections.singletonList("application/json"));
CloudFoundryWebEndpointDiscoverer discoverer = new CloudFoundryWebEndpointDiscoverer(context, parameterMapper, mediaTypes, Collections.singletonList(endpointPathMapper), Collections.singleton(new CachingOperationInvokerAdvisor(timeToLive)), Collections.emptyList());
consumer.accept(discoverer);
}
}
use of org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes in project spring-boot by spring-projects.
the class WebEndpointDiscovererTests method load.
private void load(Function<EndpointId, Long> timeToLive, PathMapper endpointPathMapper, Class<?> configuration, Consumer<WebEndpointDiscoverer> consumer) {
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(configuration)) {
ConversionServiceParameterValueMapper parameterMapper = new ConversionServiceParameterValueMapper(DefaultConversionService.getSharedInstance());
EndpointMediaTypes mediaTypes = new EndpointMediaTypes(Collections.singletonList("application/json"), Collections.singletonList("application/json"));
WebEndpointDiscoverer discoverer = new WebEndpointDiscoverer(context, parameterMapper, mediaTypes, Collections.singletonList(endpointPathMapper), Collections.singleton(new CachingOperationInvokerAdvisor(timeToLive)), Collections.emptyList());
consumer.accept(discoverer);
}
}
use of org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes in project spring-boot by spring-projects.
the class WebEndpointAutoConfigurationTests method webApplicationConfiguresEndpointMediaTypes.
@Test
void webApplicationConfiguresEndpointMediaTypes() {
this.contextRunner.run((context) -> {
EndpointMediaTypes endpointMediaTypes = context.getBean(EndpointMediaTypes.class);
assertThat(endpointMediaTypes.getConsumed()).containsExactly(V3_JSON, V2_JSON, "application/json");
});
}
Aggregations