commit
b9a1a70fcc
|
|
@ -54,7 +54,9 @@ class CassandraDataAutoConfigurationIntegrationTests {
|
|||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withConfiguration(
|
||||
AutoConfigurations.of(CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class))
|
||||
.withPropertyValues("spring.data.cassandra.contact-points:localhost:" + cassandra.getFirstMappedPort(),
|
||||
.withPropertyValues(
|
||||
"spring.data.cassandra.contact-points:" + cassandra.getContainerIpAddress() + ":"
|
||||
+ cassandra.getFirstMappedPort(),
|
||||
"spring.data.cassandra.local-datacenter=datacenter1", "spring.data.cassandra.read-timeout=20s",
|
||||
"spring.data.cassandra.connect-timeout=10s")
|
||||
.withInitializer((context) -> AutoConfigurationPackages.register((BeanDefinitionRegistry) context,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -54,7 +54,8 @@ class RedisRepositoriesAutoConfigurationTests {
|
|||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
TestPropertyValues.of("spring.redis.port=" + redis.getFirstMappedPort()).applyTo(this.context.getEnvironment());
|
||||
TestPropertyValues.of("spring.redis.host=" + redis.getContainerIpAddress(),
|
||||
"spring.redis.port=" + redis.getFirstMappedPort()).applyTo(this.context.getEnvironment());
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -63,9 +63,8 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
|
|||
|
||||
@Test
|
||||
void defaultConfig() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.session.store-type=redis",
|
||||
"spring.redis.port=" + redis.getFirstMappedPort())
|
||||
this.contextRunner.withPropertyValues("spring.session.store-type=redis",
|
||||
"spring.redis.host=" + redis.getContainerIpAddress(), "spring.redis.port=" + redis.getFirstMappedPort())
|
||||
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class))
|
||||
.run(validateSpringSessionUsesRedis("spring:session:event:0:created:", FlushMode.ON_SAVE,
|
||||
SaveMode.ON_SET_ATTRIBUTE, "0 * * * * *"));
|
||||
|
|
@ -77,7 +76,8 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
|
|||
.withClassLoader(new FilteredClassLoader(HazelcastIndexedSessionRepository.class,
|
||||
JdbcIndexedSessionRepository.class, MongoIndexedSessionRepository.class))
|
||||
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class))
|
||||
.withPropertyValues("spring.redis.port=" + redis.getFirstMappedPort())
|
||||
.withPropertyValues("spring.redis.host=" + redis.getContainerIpAddress(),
|
||||
"spring.redis.port=" + redis.getFirstMappedPort())
|
||||
.run(validateSpringSessionUsesRedis("spring:session:event:0:created:", FlushMode.ON_SAVE,
|
||||
SaveMode.ON_SET_ATTRIBUTE, "0 * * * * *"));
|
||||
}
|
||||
|
|
@ -88,6 +88,7 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
|
|||
.withPropertyValues("spring.session.store-type=redis", "spring.session.redis.namespace=foo",
|
||||
"spring.session.redis.flush-mode=immediate", "spring.session.redis.save-mode=on-get-attribute",
|
||||
"spring.session.redis.cleanup-cron=0 0 12 * * *",
|
||||
"spring.redis.host=" + redis.getContainerIpAddress(),
|
||||
"spring.redis.port=" + redis.getFirstMappedPort())
|
||||
.run(validateSpringSessionUsesRedis("foo:event:0:created:", FlushMode.IMMEDIATE,
|
||||
SaveMode.ON_GET_ATTRIBUTE, "0 0 12 * * *"));
|
||||
|
|
@ -97,6 +98,7 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
|
|||
void redisSessionWithConfigureActionNone() {
|
||||
this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class))
|
||||
.withPropertyValues("spring.session.store-type=redis", "spring.session.redis.configure-action=none",
|
||||
"spring.redis.host=" + redis.getContainerIpAddress(),
|
||||
"spring.redis.port=" + redis.getFirstMappedPort())
|
||||
.run(validateStrategy(ConfigureRedisAction.NO_OP.getClass()));
|
||||
}
|
||||
|
|
@ -105,6 +107,7 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
|
|||
void redisSessionWithDefaultConfigureActionNone() {
|
||||
this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class))
|
||||
.withPropertyValues("spring.session.store-type=redis",
|
||||
"spring.redis.host=" + redis.getContainerIpAddress(),
|
||||
"spring.redis.port=" + redis.getFirstMappedPort())
|
||||
.run(validateStrategy(ConfigureNotifyKeyspaceEventsAction.class,
|
||||
entry("notify-keyspace-events", "gxE")));
|
||||
|
|
@ -115,6 +118,7 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
|
|||
this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class))
|
||||
.withUserConfiguration(MaxEntriesRedisAction.class)
|
||||
.withPropertyValues("spring.session.store-type=redis",
|
||||
"spring.redis.host=" + redis.getContainerIpAddress(),
|
||||
"spring.redis.port=" + redis.getFirstMappedPort())
|
||||
.run(validateStrategy(MaxEntriesRedisAction.class, entry("set-max-intset-entries", "1024")));
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class DataRedisTestIntegrationTests {
|
|||
|
||||
@DynamicPropertySource
|
||||
static void redisProperties(DynamicPropertyRegistry registry) {
|
||||
registry.add("spring.redis.host", redis::getContainerIpAddress);
|
||||
registry.add("spring.redis.port", redis::getFirstMappedPort);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class DataRedisTestPropertiesIntegrationTests {
|
|||
|
||||
@DynamicPropertySource
|
||||
static void redisProperties(DynamicPropertyRegistry registry) {
|
||||
registry.add("spring.redis.host", redis::getContainerIpAddress);
|
||||
registry.add("spring.redis.port", redis::getFirstMappedPort);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class DataRedisTestWithIncludeFilterIntegrationTests {
|
|||
|
||||
@DynamicPropertySource
|
||||
static void redisProperties(DynamicPropertyRegistry registry) {
|
||||
registry.add("spring.redis.host", redis::getContainerIpAddress);
|
||||
registry.add("spring.redis.port", redis::getFirstMappedPort);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue