use of org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext in project spring-boot by spring-projects.
the class JettyMetricsAutoConfigurationTests method autoConfiguresSslHandshakeMetricsWithEmbeddedReactiveJetty.
@Test
void autoConfiguresSslHandshakeMetricsWithEmbeddedReactiveJetty() {
new ReactiveWebApplicationContextRunner(AnnotationConfigReactiveWebServerApplicationContext::new).withConfiguration(AutoConfigurations.of(JettyMetricsAutoConfiguration.class, ReactiveWebServerFactoryAutoConfiguration.class)).withUserConfiguration(ReactiveWebServerConfiguration.class, MeterRegistryConfiguration.class).withPropertyValues("server.ssl.enabled: true", "server.ssl.key-store: src/test/resources/test.jks", "server.ssl.key-store-password: secret", "server.ssl.key-password: password").run((context) -> {
context.publishEvent(createApplicationStartedEvent(context.getSourceApplicationContext()));
SimpleMeterRegistry registry = context.getBean(SimpleMeterRegistry.class);
assertThat(registry.find("jetty.ssl.handshakes").meter()).isNotNull();
});
}
use of org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext in project spring-boot by spring-projects.
the class WebEndpointTestInvocationContextProvider method createWebFluxContext.
private static ConfigurableApplicationContext createWebFluxContext(List<Class<?>> classes) {
AnnotationConfigReactiveWebServerApplicationContext context = new AnnotationConfigReactiveWebServerApplicationContext();
classes.add(WebFluxEndpointConfiguration.class);
context.register(ClassUtils.toClassArray(classes));
context.refresh();
return context;
}
use of org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext in project spring-boot by spring-projects.
the class WebFluxEndpointIntegrationTests method createApplicationContext.
private static AnnotationConfigReactiveWebServerApplicationContext createApplicationContext() {
AnnotationConfigReactiveWebServerApplicationContext context = new AnnotationConfigReactiveWebServerApplicationContext();
context.register(ReactiveConfiguration.class);
return context;
}
use of org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext in project spring-boot by spring-projects.
the class ReactiveWebServerFactoryAutoConfigurationTests method tomcatContextCustomizerBeanIsAddedToFactory.
@Test
void tomcatContextCustomizerBeanIsAddedToFactory() {
ReactiveWebApplicationContextRunner runner = new ReactiveWebApplicationContextRunner(AnnotationConfigReactiveWebServerApplicationContext::new).withConfiguration(AutoConfigurations.of(ReactiveWebServerFactoryAutoConfiguration.class)).withUserConfiguration(HttpHandlerConfiguration.class, TomcatContextCustomizerConfiguration.class).withPropertyValues("server.port: 0");
runner.run((context) -> {
TomcatReactiveWebServerFactory factory = context.getBean(TomcatReactiveWebServerFactory.class);
TomcatContextCustomizer customizer = context.getBean("contextCustomizer", TomcatContextCustomizer.class);
assertThat(factory.getTomcatContextCustomizers()).contains(customizer);
then(customizer).should().customize(any(Context.class));
});
}
Aggregations