use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class RabbitConnectionFactoryXmlConfigTest method cloudRabbitConnectionFactoryWithConfigurationAndProperties.
@Test
public void cloudRabbitConnectionFactoryWithConfigurationAndProperties() {
ApplicationContext testContext = getTestApplicationContext("cloud-rabbit-with-config.xml", createService("my-service"));
ConnectionFactory connector = testContext.getBean("service-channelCacheSize200-properties", getConnectorType());
RabbitConnectionFactoryCloudConfigTestHelper.assertConfigProperties(connector, 200, 5, 10);
}
use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class RabbitConnectionFactoryXmlConfigTest method cloudRabbitConnectionFactoryWithProperties.
@Test
public void cloudRabbitConnectionFactoryWithProperties() {
ApplicationContext testContext = getTestApplicationContext("cloud-rabbit-with-config.xml", createService("my-service"));
ConnectionFactory connector = testContext.getBean("service-properties", getConnectorType());
RabbitConnectionFactoryCloudConfigTestHelper.assertConfigProperties(connector, DEFAULT_CHANNEL_CACHE_SIZE, 5, 10);
}
use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class RabbitConnectionFactoryXmlConfigTest method cloudRabbitConnectionFactoryWithConfiguration.
@Test
public void cloudRabbitConnectionFactoryWithConfiguration() {
ApplicationContext testContext = getTestApplicationContext("cloud-rabbit-with-config.xml", createService("my-service"));
ConnectionFactory connector = testContext.getBean("service-channelCacheSize200", getConnectorType());
RabbitConnectionFactoryCloudConfigTestHelper.assertConfigProperties(connector, 200, -1, -1);
}
use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class RedisConnectionFactoryXmlConfigTest method cloudRedisConnectionFactoryWithMaxPool.
@Test
public void cloudRedisConnectionFactoryWithMaxPool() {
ApplicationContext testContext = getTestApplicationContext("cloud-redis-with-config.xml", createService("my-service"));
RedisConnectionFactory connector = testContext.getBean("service-pool20-wait200", getConnectorType());
RedisConnectionFactoryCloudConfigTestHelper.assertPoolProperties(connector, 20, 0, 200);
}
use of org.springframework.context.ApplicationContext in project spring-boot by spring-projects.
the class EndpointWebMvcAutoConfigurationTests method managementServerCanDisableSslWhenUsingADifferentPort.
@Test
public void managementServerCanDisableSslWhenUsingADifferentPort() throws Exception {
EnvironmentTestUtils.addEnvironment(this.applicationContext, "management.port=" + ports.get().management, "server.ssl.enabled=true", "server.ssl.key-store=classpath:test.jks", "server.ssl.key-password=password", "management.ssl.enabled=false");
this.applicationContext.register(RootConfig.class, EndpointConfig.class, DifferentPortConfig.class, BaseConfiguration.class, EndpointWebMvcAutoConfiguration.class, ErrorMvcAutoConfiguration.class);
this.applicationContext.refresh();
assertHttpsContent("/controller", ports.get().server, "controlleroutput");
assertHttpsContent("/endpoint", ports.get().server, null);
assertContent("/controller", ports.get().management, null);
assertContent("/endpoint", ports.get().management, "endpointoutput");
assertContent("/error", ports.get().management, startsWith("{"));
ApplicationContext managementContext = this.applicationContext.getBean(ManagementContextResolver.class).getApplicationContext();
List<?> interceptors = (List<?>) ReflectionTestUtils.getField(managementContext.getBean(EndpointHandlerMapping.class), "interceptors");
assertThat(interceptors).hasSize(1);
ManagementServerProperties managementServerProperties = this.applicationContext.getBean(ManagementServerProperties.class);
assertThat(managementServerProperties.getSsl()).isNotNull();
assertThat(managementServerProperties.getSsl().isEnabled()).isFalse();
}
Aggregations