Align with spring-javaformat 0.0.15
This commit is contained in:
@@ -7,5 +7,4 @@
|
||||
<suppress files="[\\/]spring-session-docs[\\/]" checks="InnerTypeLast"/>
|
||||
<suppress files="[\\/]spring-session-samples[\\/]" checks="Javadoc*"/>
|
||||
<suppress files="[\\/]spring-session-samples[\\/].+Application\.java" checks="HideUtilityClassConstructor"/>
|
||||
<suppress files="SessionRepositoryFilterTests\.java" checks="SpringLambda"/>
|
||||
</suppressions>
|
||||
|
||||
@@ -65,11 +65,7 @@ class HttpSessionAdapter<S extends Session> implements HttpSession {
|
||||
this.servletContext = servletContext;
|
||||
}
|
||||
|
||||
public void setSession(S session) {
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
public S getSession() {
|
||||
S getSession() {
|
||||
return this.session;
|
||||
}
|
||||
|
||||
@@ -191,16 +187,16 @@ class HttpSessionAdapter<S extends Session> implements HttpSession {
|
||||
this.invalidated = true;
|
||||
}
|
||||
|
||||
public void setNew(boolean isNew) {
|
||||
this.old = !isNew;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNew() {
|
||||
checkState();
|
||||
return !this.old;
|
||||
}
|
||||
|
||||
void markNotNew() {
|
||||
this.old = true;
|
||||
}
|
||||
|
||||
private void checkState() {
|
||||
if (this.invalidated) {
|
||||
throw new IllegalStateException("The HttpSession has already be invalidated.");
|
||||
|
||||
@@ -25,9 +25,6 @@ import javax.servlet.WriteListener;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponseWrapper;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Base class for response wrappers which encapsulate the logic for handling an event when
|
||||
* the {@link javax.servlet.http.HttpServletResponse} is committed.
|
||||
@@ -37,8 +34,6 @@ import org.apache.commons.logging.LogFactory;
|
||||
*/
|
||||
abstract class OnCommittedResponseWrapper extends HttpServletResponseWrapper {
|
||||
|
||||
private final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private boolean disableOnCommitted;
|
||||
|
||||
/**
|
||||
@@ -92,7 +87,7 @@ abstract class OnCommittedResponseWrapper extends HttpServletResponseWrapper {
|
||||
* {@link javax.servlet.http.HttpServletResponse} is committed. This can be useful in
|
||||
* the event that Async Web Requests are made.
|
||||
*/
|
||||
public void disableOnResponseCommitted() {
|
||||
private void disableOnResponseCommitted() {
|
||||
this.disableOnCommitted = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ public class SessionRepositoryFilter<S extends Session> extends OncePerRequestFi
|
||||
requestedSession.setLastAccessedTime(Instant.now());
|
||||
this.requestedSessionIdValid = true;
|
||||
currentSession = new HttpSessionWrapper(requestedSession, getServletContext());
|
||||
currentSession.setNew(false);
|
||||
currentSession.markNotNew();
|
||||
setCurrentSession(currentSession);
|
||||
return currentSession;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ class DelegatingIndexResolverTests {
|
||||
this.supportedIndex = supportedIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> resolveIndexesFor(MapSession session) {
|
||||
return Collections.singletonMap(this.supportedIndex, session.getAttribute(this.supportedIndex));
|
||||
}
|
||||
|
||||
@@ -126,12 +126,12 @@ class EnableSpringHttpSessionCustomCookieSerializerTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public SessionRepository sessionRepository() {
|
||||
SessionRepository sessionRepository() {
|
||||
return mock(SessionRepository.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CookieSerializer cookieSerializer() {
|
||||
CookieSerializer cookieSerializer() {
|
||||
return mock(CookieSerializer.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ class SpringHttpSessionConfigurationTests {
|
||||
static class BaseConfiguration {
|
||||
|
||||
@Bean
|
||||
public MapSessionRepository sessionRepository() {
|
||||
MapSessionRepository sessionRepository() {
|
||||
return new MapSessionRepository(new ConcurrentHashMap<>());
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ class SpringHttpSessionConfigurationTests {
|
||||
static class SessionCookieConfigConfiguration extends BaseConfiguration {
|
||||
|
||||
@Bean
|
||||
public ServletContext servletContext() {
|
||||
ServletContext servletContext() {
|
||||
MockServletContext servletContext = new MockServletContext();
|
||||
servletContext.getSessionCookieConfig().setName("test-name");
|
||||
servletContext.getSessionCookieConfig().setDomain("test-domain");
|
||||
@@ -153,7 +153,7 @@ class SpringHttpSessionConfigurationTests {
|
||||
static class RememberMeServicesConfiguration extends BaseConfiguration {
|
||||
|
||||
@Bean
|
||||
public SpringSessionRememberMeServices rememberMeServices() {
|
||||
SpringSessionRememberMeServices rememberMeServices() {
|
||||
return new SpringSessionRememberMeServices();
|
||||
}
|
||||
|
||||
|
||||
@@ -499,7 +499,7 @@ class DefaultCookieSerializerTests {
|
||||
assertThat(getCookie().getSameSite()).isNull();
|
||||
}
|
||||
|
||||
public void setCookieName(String cookieName) {
|
||||
void setCookieName(String cookieName) {
|
||||
this.cookieName = cookieName;
|
||||
this.serializer.setCookieName(cookieName);
|
||||
}
|
||||
|
||||
@@ -1331,11 +1331,8 @@ class SessionRepositoryFilterTests {
|
||||
|
||||
// We want the filter to work without any dependencies on Spring
|
||||
@Test
|
||||
@SuppressWarnings("unused")
|
||||
void doesNotImplementOrdered() {
|
||||
assertThatExceptionOfType(ClassCastException.class).isThrownBy(() -> {
|
||||
Ordered o = (Ordered) this.filter;
|
||||
});
|
||||
assertThatExceptionOfType(ClassCastException.class).isThrownBy(() -> Ordered.class.cast(this.filter));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -617,7 +617,7 @@ class RedisIndexedSessionRepositoryITests extends AbstractRedisITests {
|
||||
static class Config extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
public SessionEventRegistry sessionEventRegistry() {
|
||||
SessionEventRegistry sessionEventRegistry() {
|
||||
return new SessionEventRegistry();
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ class RedisSessionRepositoryITests extends AbstractRedisITests {
|
||||
static class Config extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
public RedisSessionRepository sessionRepository(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisSessionRepository sessionRepository(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setConnectionFactory(redisConnectionFactory);
|
||||
redisTemplate.afterPropertiesSet();
|
||||
|
||||
@@ -102,11 +102,11 @@ class EnableRedisHttpSessionExpireSessionDestroyedTests<S extends Session> exten
|
||||
}
|
||||
}
|
||||
|
||||
public boolean receivedEvent() {
|
||||
boolean receivedEvent() {
|
||||
return this.receivedEvent;
|
||||
}
|
||||
|
||||
public void setLock(Object lock) {
|
||||
void setLock(Object lock) {
|
||||
this.lock = lock;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ class EnableRedisHttpSessionExpireSessionDestroyedTests<S extends Session> exten
|
||||
static class Config extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
public SessionExpiredEventRegistry sessionDestroyedEventRegistry() {
|
||||
SessionExpiredEventRegistry sessionDestroyedEventRegistry() {
|
||||
return new SessionExpiredEventRegistry();
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ class RedisListenerContainerTaskExecutorITests extends AbstractRedisITests {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean taskDispatched() throws InterruptedException {
|
||||
boolean taskDispatched() throws InterruptedException {
|
||||
if (this.taskDispatched != null) {
|
||||
return this.taskDispatched;
|
||||
}
|
||||
@@ -105,12 +105,12 @@ class RedisListenerContainerTaskExecutorITests extends AbstractRedisITests {
|
||||
static class Config extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
public Executor springSessionRedisTaskExecutor() {
|
||||
Executor springSessionRedisTaskExecutor() {
|
||||
return new SessionTaskExecutor(Executors.newSingleThreadExecutor());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Executor springSessionRedisSubscriptionExecutor() {
|
||||
Executor springSessionRedisSubscriptionExecutor() {
|
||||
return new SimpleAsyncTaskExecutor();
|
||||
}
|
||||
|
||||
|
||||
@@ -396,10 +396,10 @@ public class RedisIndexedSessionRepository
|
||||
@Override
|
||||
public void save(RedisSession session) {
|
||||
session.save();
|
||||
if (session.isNew()) {
|
||||
if (session.isNew) {
|
||||
String sessionCreatedKey = getSessionCreatedChannel(session.getId());
|
||||
this.sessionRedisOperations.convertAndSend(sessionCreatedKey, session.delta);
|
||||
session.setNew(false);
|
||||
session.isNew = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -699,10 +699,6 @@ public class RedisIndexedSessionRepository
|
||||
}
|
||||
}
|
||||
|
||||
public void setNew(boolean isNew) {
|
||||
this.isNew = isNew;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLastAccessedTime(Instant lastAccessedTime) {
|
||||
this.cached.setLastAccessedTime(lastAccessedTime);
|
||||
@@ -715,10 +711,6 @@ public class RedisIndexedSessionRepository
|
||||
return this.cached.isExpired();
|
||||
}
|
||||
|
||||
public boolean isNew() {
|
||||
return this.isNew;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instant getCreationTime() {
|
||||
return this.cached.getCreationTime();
|
||||
@@ -832,7 +824,7 @@ public class RedisIndexedSessionRepository
|
||||
if (sessionId.equals(this.originalSessionId)) {
|
||||
return;
|
||||
}
|
||||
if (!isNew()) {
|
||||
if (!this.isNew) {
|
||||
String originalSessionIdKey = getSessionKey(this.originalSessionId);
|
||||
String sessionIdKey = getSessionKey(sessionId);
|
||||
try {
|
||||
|
||||
@@ -64,13 +64,13 @@ final class RedisSessionExpirationPolicy {
|
||||
this.lookupSessionKey = lookupSessionKey;
|
||||
}
|
||||
|
||||
public void onDelete(Session session) {
|
||||
void onDelete(Session session) {
|
||||
long toExpire = roundUpToNextMinute(expiresInMillis(session));
|
||||
String expireKey = getExpirationKey(toExpire);
|
||||
this.redis.boundSetOps(expireKey).remove(session.getId());
|
||||
}
|
||||
|
||||
public void onExpirationUpdated(Long originalExpirationTimeInMilli, Session session) {
|
||||
void onExpirationUpdated(Long originalExpirationTimeInMilli, Session session) {
|
||||
String keyToExpire = "expires:" + session.getId();
|
||||
long toExpire = roundUpToNextMinute(expiresInMillis(session));
|
||||
|
||||
@@ -117,7 +117,7 @@ final class RedisSessionExpirationPolicy {
|
||||
return this.lookupSessionKey.apply(sessionId);
|
||||
}
|
||||
|
||||
public void cleanExpiredSessions() {
|
||||
void cleanExpiredSessions() {
|
||||
long now = System.currentTimeMillis();
|
||||
long prevMin = roundDownMinute(now);
|
||||
|
||||
|
||||
@@ -46,12 +46,12 @@ class RedisHttpSessionConfigurationNoOpConfigureRedisActionTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public static ConfigureRedisAction configureRedisAction() {
|
||||
ConfigureRedisAction configureRedisAction() {
|
||||
return ConfigureRedisAction.NO_OP;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory redisConnectionFactory() {
|
||||
RedisConnectionFactory redisConnectionFactory() {
|
||||
return mock(RedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,12 +65,12 @@ class RedisHttpSessionConfigurationOverrideDefaultSerializerTests {
|
||||
|
||||
@Bean
|
||||
@SuppressWarnings("unchecked")
|
||||
public RedisSerializer<Object> springSessionDefaultRedisSerializer() {
|
||||
RedisSerializer<Object> springSessionDefaultRedisSerializer() {
|
||||
return mock(RedisSerializer.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory connectionFactory() {
|
||||
RedisConnectionFactory connectionFactory() {
|
||||
RedisConnectionFactory factory = mock(RedisConnectionFactory.class);
|
||||
RedisConnection connection = mock(RedisConnection.class);
|
||||
given(factory.getConnection()).willReturn(connection);
|
||||
|
||||
@@ -65,12 +65,12 @@ class RedisHttpSessionConfigurationOverrideSessionTaskExecutor {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public Executor springSessionRedisTaskExecutor() {
|
||||
Executor springSessionRedisTaskExecutor() {
|
||||
return mock(Executor.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory connectionFactory() {
|
||||
RedisConnectionFactory connectionFactory() {
|
||||
RedisConnectionFactory factory = mock(RedisConnectionFactory.class);
|
||||
RedisConnection connection = mock(RedisConnection.class);
|
||||
given(factory.getConnection()).willReturn(connection);
|
||||
|
||||
@@ -71,17 +71,17 @@ class RedisHttpSessionConfigurationOverrideSessionTaskExecutors {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public Executor springSessionRedisTaskExecutor() {
|
||||
Executor springSessionRedisTaskExecutor() {
|
||||
return mock(Executor.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Executor springSessionRedisSubscriptionExecutor() {
|
||||
Executor springSessionRedisSubscriptionExecutor() {
|
||||
return mock(Executor.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory connectionFactory() {
|
||||
RedisConnectionFactory connectionFactory() {
|
||||
RedisConnectionFactory factory = mock(RedisConnectionFactory.class);
|
||||
RedisConnection connection = mock(RedisConnection.class);
|
||||
given(factory.getConnection()).willReturn(connection);
|
||||
|
||||
@@ -275,7 +275,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
static class PropertySourceConfiguration {
|
||||
|
||||
@Bean
|
||||
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
return new PropertySourcesPlaceholderConfigurer();
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
static class RedisConfig {
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory defaultRedisConnectionFactory() {
|
||||
RedisConnectionFactory defaultRedisConnectionFactory() {
|
||||
return mockRedisConnectionFactory();
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SpringSessionRedisConnectionFactory
|
||||
public RedisConnectionFactory qualifiedRedisConnectionFactory() {
|
||||
RedisConnectionFactory qualifiedRedisConnectionFactory() {
|
||||
return mockRedisConnectionFactory();
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public RedisConnectionFactory primaryRedisConnectionFactory() {
|
||||
RedisConnectionFactory primaryRedisConnectionFactory() {
|
||||
return mockRedisConnectionFactory();
|
||||
}
|
||||
|
||||
@@ -381,13 +381,13 @@ class RedisHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SpringSessionRedisConnectionFactory
|
||||
public RedisConnectionFactory qualifiedRedisConnectionFactory() {
|
||||
RedisConnectionFactory qualifiedRedisConnectionFactory() {
|
||||
return mockRedisConnectionFactory();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public RedisConnectionFactory primaryRedisConnectionFactory() {
|
||||
RedisConnectionFactory primaryRedisConnectionFactory() {
|
||||
return mockRedisConnectionFactory();
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
static class NamedConnectionFactoryRedisConfig {
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory redisConnectionFactory() {
|
||||
RedisConnectionFactory redisConnectionFactory() {
|
||||
return mockRedisConnectionFactory();
|
||||
}
|
||||
|
||||
@@ -409,7 +409,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
static class MultipleConnectionFactoryRedisConfig {
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory secondaryRedisConnectionFactory() {
|
||||
RedisConnectionFactory secondaryRedisConnectionFactory() {
|
||||
return mockRedisConnectionFactory();
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SuppressWarnings("unchecked")
|
||||
public IndexResolver<Session> indexResolver() {
|
||||
IndexResolver<Session> indexResolver() {
|
||||
return mock(IndexResolver.class);
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
static class CustomRedisMessageListenerContainerConfig {
|
||||
|
||||
@Bean
|
||||
public RedisMessageListenerContainer redisMessageListenerContainer() {
|
||||
RedisMessageListenerContainer redisMessageListenerContainer() {
|
||||
return new RedisMessageListenerContainer();
|
||||
}
|
||||
|
||||
@@ -455,13 +455,13 @@ class RedisHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Order(0)
|
||||
public SessionRepositoryCustomizer<RedisIndexedSessionRepository> sessionRepositoryCustomizerOne() {
|
||||
SessionRepositoryCustomizer<RedisIndexedSessionRepository> sessionRepositoryCustomizerOne() {
|
||||
return (sessionRepository) -> sessionRepository.setDefaultMaxInactiveInterval(0);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(1)
|
||||
public SessionRepositoryCustomizer<RedisIndexedSessionRepository> sessionRepositoryCustomizerTwo() {
|
||||
SessionRepositoryCustomizer<RedisIndexedSessionRepository> sessionRepositoryCustomizerTwo() {
|
||||
return (sessionRepository) -> sessionRepository
|
||||
.setDefaultMaxInactiveInterval(MAX_INACTIVE_INTERVAL_IN_SECONDS);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class Gh109Tests {
|
||||
* override sessionRepository construction to set the custom session-timeout
|
||||
*/
|
||||
@Bean
|
||||
public RedisIndexedSessionRepository sessionRepository(RedisOperations<Object, Object> sessionRedisTemplate,
|
||||
RedisIndexedSessionRepository sessionRepository(RedisOperations<Object, Object> sessionRedisTemplate,
|
||||
ApplicationEventPublisher applicationEventPublisher) {
|
||||
RedisIndexedSessionRepository sessionRepository = new RedisIndexedSessionRepository(sessionRedisTemplate);
|
||||
sessionRepository.setDefaultMaxInactiveInterval(this.sessionTimeout);
|
||||
@@ -70,7 +70,7 @@ class Gh109Tests {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory redisConnectionFactory() {
|
||||
RedisConnectionFactory redisConnectionFactory() {
|
||||
RedisConnectionFactory factory = mock(RedisConnectionFactory.class);
|
||||
RedisConnection connection = mock(RedisConnection.class);
|
||||
given(factory.getConnection()).willReturn(connection);
|
||||
|
||||
@@ -232,7 +232,7 @@ class RedisWebSessionConfigurationTests {
|
||||
static class RedisConfig {
|
||||
|
||||
@Bean
|
||||
public ReactiveRedisConnectionFactory defaultRedisConnectionFactory() {
|
||||
ReactiveRedisConnectionFactory defaultRedisConnectionFactory() {
|
||||
return mock(ReactiveRedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ class RedisWebSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SpringSessionRedisConnectionFactory
|
||||
public ReactiveRedisConnectionFactory qualifiedRedisConnectionFactory() {
|
||||
ReactiveRedisConnectionFactory qualifiedRedisConnectionFactory() {
|
||||
return mock(ReactiveRedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ class RedisWebSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public ReactiveRedisConnectionFactory primaryRedisConnectionFactory() {
|
||||
ReactiveRedisConnectionFactory primaryRedisConnectionFactory() {
|
||||
return mock(ReactiveRedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
@@ -306,13 +306,13 @@ class RedisWebSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SpringSessionRedisConnectionFactory
|
||||
public ReactiveRedisConnectionFactory qualifiedRedisConnectionFactory() {
|
||||
ReactiveRedisConnectionFactory qualifiedRedisConnectionFactory() {
|
||||
return mock(ReactiveRedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public ReactiveRedisConnectionFactory primaryRedisConnectionFactory() {
|
||||
ReactiveRedisConnectionFactory primaryRedisConnectionFactory() {
|
||||
return mock(ReactiveRedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ class RedisWebSessionConfigurationTests {
|
||||
static class NamedConnectionFactoryRedisConfig {
|
||||
|
||||
@Bean
|
||||
public ReactiveRedisConnectionFactory redisConnectionFactory() {
|
||||
ReactiveRedisConnectionFactory redisConnectionFactory() {
|
||||
return mock(ReactiveRedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ class RedisWebSessionConfigurationTests {
|
||||
static class MultipleConnectionFactoryRedisConfig {
|
||||
|
||||
@Bean
|
||||
public ReactiveRedisConnectionFactory secondaryRedisConnectionFactory() {
|
||||
ReactiveRedisConnectionFactory secondaryRedisConnectionFactory() {
|
||||
return mock(ReactiveRedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ class RedisWebSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SuppressWarnings("unchecked")
|
||||
public RedisSerializer<Object> springSessionDefaultRedisSerializer() {
|
||||
RedisSerializer<Object> springSessionDefaultRedisSerializer() {
|
||||
return mock(RedisSerializer.class);
|
||||
}
|
||||
|
||||
@@ -354,13 +354,13 @@ class RedisWebSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Order(0)
|
||||
public ReactiveSessionRepositoryCustomizer<ReactiveRedisSessionRepository> sessionRepositoryCustomizerOne() {
|
||||
ReactiveSessionRepositoryCustomizer<ReactiveRedisSessionRepository> sessionRepositoryCustomizerOne() {
|
||||
return (sessionRepository) -> sessionRepository.setDefaultMaxInactiveInterval(0);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(1)
|
||||
public ReactiveSessionRepositoryCustomizer<ReactiveRedisSessionRepository> sessionRepositoryCustomizerTwo() {
|
||||
ReactiveSessionRepositoryCustomizer<ReactiveRedisSessionRepository> sessionRepositoryCustomizerTwo() {
|
||||
return (sessionRepository) -> sessionRepository
|
||||
.setDefaultMaxInactiveInterval(MAX_INACTIVE_INTERVAL_IN_SECONDS);
|
||||
}
|
||||
|
||||
@@ -48,13 +48,13 @@ class RedisHttpSessionConfigurationNoOpConfigureRedisActionTests {
|
||||
|
||||
// tag::configure-redis-action[]
|
||||
@Bean
|
||||
public static ConfigureRedisAction configureRedisAction() {
|
||||
ConfigureRedisAction configureRedisAction() {
|
||||
return ConfigureRedisAction.NO_OP;
|
||||
}
|
||||
// end::configure-redis-action[]
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory redisConnectionFactory() {
|
||||
RedisConnectionFactory redisConnectionFactory() {
|
||||
return mock(RedisConnectionFactory.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@ class HttpSessionListenerJavaConfigTests extends AbstractHttpSessionListenerTest
|
||||
static class MockConfig {
|
||||
|
||||
@Bean
|
||||
public static RedisConnectionFactory redisConnectionFactory() {
|
||||
static RedisConnectionFactory redisConnectionFactory() {
|
||||
return AbstractHttpSessionListenerTests.createMockRedisConnection();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecuritySessionDestroyedListener securitySessionDestroyedListener() {
|
||||
SecuritySessionDestroyedListener securitySessionDestroyedListener() {
|
||||
return new SecuritySessionDestroyedListener();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class ClientServerHazelcastIndexedSessionRepositoryITests extends AbstractHazelc
|
||||
static class HazelcastSessionConfig {
|
||||
|
||||
@Bean
|
||||
public HazelcastInstance hazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance() {
|
||||
ClientConfig clientConfig = new ClientConfig();
|
||||
clientConfig.getNetworkConfig()
|
||||
.addAddress(container.getContainerIpAddress() + ":" + container.getFirstMappedPort());
|
||||
|
||||
@@ -43,7 +43,7 @@ class EmbeddedHazelcastIndexedSessionRepositoryITests extends AbstractHazelcastI
|
||||
static class HazelcastSessionConfig {
|
||||
|
||||
@Bean
|
||||
public HazelcastInstance hazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance() {
|
||||
return HazelcastITestUtils.embeddedHazelcastServer();
|
||||
}
|
||||
|
||||
|
||||
@@ -206,12 +206,12 @@ class EnableHazelcastHttpSessionEventsTests<S extends Session> {
|
||||
static class HazelcastSessionConfig {
|
||||
|
||||
@Bean
|
||||
public HazelcastInstance embeddedHazelcast() {
|
||||
HazelcastInstance embeddedHazelcast() {
|
||||
return HazelcastITestUtils.embeddedHazelcastServer();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SessionEventRegistry sessionEventRegistry() {
|
||||
SessionEventRegistry sessionEventRegistry() {
|
||||
return new SessionEventRegistry();
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class HazelcastHttpSessionConfigurationXmlTests<S extends Session> {
|
||||
static class HazelcastSessionXmlConfigCustomMapName {
|
||||
|
||||
@Bean
|
||||
public HazelcastInstance embeddedHazelcast() {
|
||||
HazelcastInstance embeddedHazelcast() {
|
||||
Config hazelcastConfig = new ClasspathXmlConfig(
|
||||
"org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml");
|
||||
NetworkConfig netConfig = new NetworkConfig();
|
||||
@@ -111,7 +111,7 @@ public class HazelcastHttpSessionConfigurationXmlTests<S extends Session> {
|
||||
static class HazelcastSessionXmlConfigCustomMapNameAndIdle {
|
||||
|
||||
@Bean
|
||||
public HazelcastInstance embeddedHazelcast() {
|
||||
HazelcastInstance embeddedHazelcast() {
|
||||
Config hazelcastConfig = new ClasspathXmlConfig(
|
||||
"org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml");
|
||||
NetworkConfig netConfig = new NetworkConfig();
|
||||
|
||||
@@ -262,7 +262,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
static IMap<Object, Object> defaultHazelcastInstanceSessions = mock(IMap.class);
|
||||
|
||||
@Bean
|
||||
public HazelcastInstance defaultHazelcastInstance() {
|
||||
HazelcastInstance defaultHazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance = mock(HazelcastInstance.class);
|
||||
given(hazelcastInstance.getMap(anyString())).willReturn(defaultHazelcastInstanceSessions);
|
||||
return hazelcastInstance;
|
||||
@@ -361,7 +361,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SpringSessionHazelcastInstance
|
||||
public HazelcastInstance qualifiedHazelcastInstance() {
|
||||
HazelcastInstance qualifiedHazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance = mock(HazelcastInstance.class);
|
||||
given(hazelcastInstance.getMap(anyString())).willReturn(qualifiedHazelcastInstanceSessions);
|
||||
return hazelcastInstance;
|
||||
@@ -378,7 +378,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public HazelcastInstance primaryHazelcastInstance() {
|
||||
HazelcastInstance primaryHazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance = mock(HazelcastInstance.class);
|
||||
given(hazelcastInstance.getMap(anyString())).willReturn(primaryHazelcastInstanceSessions);
|
||||
return hazelcastInstance;
|
||||
@@ -398,7 +398,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SpringSessionHazelcastInstance
|
||||
public HazelcastInstance qualifiedHazelcastInstance() {
|
||||
HazelcastInstance qualifiedHazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance = mock(HazelcastInstance.class);
|
||||
given(hazelcastInstance.getMap(anyString())).willReturn(qualifiedHazelcastInstanceSessions);
|
||||
return hazelcastInstance;
|
||||
@@ -406,7 +406,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public HazelcastInstance primaryHazelcastInstance() {
|
||||
HazelcastInstance primaryHazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance = mock(HazelcastInstance.class);
|
||||
given(hazelcastInstance.getMap(anyString())).willReturn(primaryHazelcastInstanceSessions);
|
||||
return hazelcastInstance;
|
||||
@@ -422,7 +422,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
static IMap<Object, Object> hazelcastInstanceSessions = mock(IMap.class);
|
||||
|
||||
@Bean
|
||||
public HazelcastInstance hazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance = mock(HazelcastInstance.class);
|
||||
given(hazelcastInstance.getMap(anyString())).willReturn(hazelcastInstanceSessions);
|
||||
return hazelcastInstance;
|
||||
@@ -438,7 +438,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
static IMap<Object, Object> secondaryHazelcastInstanceSessions = mock(IMap.class);
|
||||
|
||||
@Bean
|
||||
public HazelcastInstance secondaryHazelcastInstance() {
|
||||
HazelcastInstance secondaryHazelcastInstance() {
|
||||
HazelcastInstance hazelcastInstance = mock(HazelcastInstance.class);
|
||||
given(hazelcastInstance.getMap(anyString())).willReturn(secondaryHazelcastInstanceSessions);
|
||||
return hazelcastInstance;
|
||||
@@ -451,7 +451,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SuppressWarnings("unchecked")
|
||||
public IndexResolver<Session> indexResolver() {
|
||||
IndexResolver<Session> indexResolver() {
|
||||
return mock(IndexResolver.class);
|
||||
}
|
||||
|
||||
@@ -462,13 +462,13 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Order(0)
|
||||
public SessionRepositoryCustomizer<HazelcastIndexedSessionRepository> sessionRepositoryCustomizerOne() {
|
||||
SessionRepositoryCustomizer<HazelcastIndexedSessionRepository> sessionRepositoryCustomizerOne() {
|
||||
return (sessionRepository) -> sessionRepository.setDefaultMaxInactiveInterval(0);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(1)
|
||||
public SessionRepositoryCustomizer<HazelcastIndexedSessionRepository> sessionRepositoryCustomizerTwo() {
|
||||
SessionRepositoryCustomizer<HazelcastIndexedSessionRepository> sessionRepositoryCustomizerTwo() {
|
||||
return (sessionRepository) -> sessionRepository
|
||||
.setDefaultMaxInactiveInterval(MAX_INACTIVE_INTERVAL_IN_SECONDS);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ abstract class AbstractContainerJdbcIndexedSessionRepositoryITests extends Abstr
|
||||
static class BaseContainerConfig extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
public HikariDataSource dataSource(JdbcDatabaseContainer databaseContainer) {
|
||||
HikariDataSource dataSource(JdbcDatabaseContainer databaseContainer) {
|
||||
HikariDataSource dataSource = new HikariDataSource();
|
||||
dataSource.setJdbcUrl(databaseContainer.getJdbcUrl());
|
||||
dataSource.setUsername(databaseContainer.getUsername());
|
||||
@@ -45,7 +45,7 @@ abstract class AbstractContainerJdbcIndexedSessionRepositoryITests extends Abstr
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DataSourceInitializer dataSourceInitializer(DataSource dataSource, DatabasePopulator databasePopulator) {
|
||||
DataSourceInitializer dataSourceInitializer(DataSource dataSource, DatabasePopulator databasePopulator) {
|
||||
DataSourceInitializer initializer = new DataSourceInitializer();
|
||||
initializer.setDataSource(dataSource);
|
||||
initializer.setDatabasePopulator(databasePopulator);
|
||||
|
||||
@@ -771,7 +771,7 @@ abstract class AbstractJdbcIndexedSessionRepositoryITests {
|
||||
static class BaseConfig {
|
||||
|
||||
@Bean
|
||||
public PlatformTransactionManager transactionManager(DataSource dataSource) {
|
||||
PlatformTransactionManager transactionManager(DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ class Db211JdbcIndexedSessionRepositoryITests extends AbstractContainerJdbcIndex
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public Db2Container databaseContainer() {
|
||||
Db2Container databaseContainer() {
|
||||
Db2Container databaseContainer = DatabaseContainers.db211();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.db2();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class DerbyJdbcIndexedSessionRepositoryITests extends AbstractJdbcIndexedSession
|
||||
static class Config extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
public EmbeddedDatabase dataSource() {
|
||||
EmbeddedDatabase dataSource() {
|
||||
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY)
|
||||
.addScript("org/springframework/session/jdbc/schema-derby.sql").build();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class H2JdbcIndexedSessionRepositoryITests extends AbstractJdbcIndexedSessionRep
|
||||
static class Config extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
public EmbeddedDatabase dataSource() {
|
||||
EmbeddedDatabase dataSource() {
|
||||
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2)
|
||||
.addScript("org/springframework/session/jdbc/schema-h2.sql").build();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class HsqldbJdbcIndexedSessionRepositoryITests extends AbstractJdbcIndexedSessio
|
||||
static class Config extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
public EmbeddedDatabase dataSource() {
|
||||
EmbeddedDatabase dataSource() {
|
||||
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL)
|
||||
.addScript("org/springframework/session/jdbc/schema-hsqldb.sql").build();
|
||||
}
|
||||
|
||||
@@ -40,14 +40,14 @@ class MariaDb10JdbcIndexedSessionRepositoryITests extends AbstractContainerJdbcI
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public MariaDBContainer databaseContainer() {
|
||||
MariaDBContainer databaseContainer() {
|
||||
MariaDBContainer databaseContainer = DatabaseContainers.mariaDb10();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.mySql();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ class MariaDb5JdbcIndexedSessionRepositoryITests extends AbstractContainerJdbcIn
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public MariaDBContainer databaseContainer() {
|
||||
MariaDBContainer databaseContainer() {
|
||||
MariaDBContainer databaseContainer = DatabaseContainers.mariaDb5();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.mySql();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ class MySql5JdbcIndexedSessionRepositoryITests extends AbstractContainerJdbcInde
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public MySQLContainer databaseContainer() {
|
||||
MySQLContainer databaseContainer() {
|
||||
MySQLContainer databaseContainer = DatabaseContainers.mySql5();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.mySql();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ class MySql8JdbcIndexedSessionRepositoryITests extends AbstractContainerJdbcInde
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public MySQLContainer databaseContainer() {
|
||||
MySQLContainer databaseContainer() {
|
||||
MySQLContainer databaseContainer = DatabaseContainers.mySql8();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.mySql();
|
||||
}
|
||||
|
||||
|
||||
@@ -53,14 +53,14 @@ class OracleJdbcIndexedSessionRepositoryITests extends AbstractContainerJdbcInde
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public OracleContainer databaseContainer() {
|
||||
OracleContainer databaseContainer() {
|
||||
OracleContainer databaseContainer = DatabaseContainers.oracleXe();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.oracle();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,14 +41,14 @@ class PostgreSql10JdbcIndexedSessionRepositoryITests extends AbstractContainerJd
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public PostgreSQLContainer databaseContainer() {
|
||||
PostgreSQLContainer databaseContainer() {
|
||||
PostgreSQLContainer databaseContainer = DatabaseContainers.postgreSql10();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.postgreSql();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,14 +41,14 @@ class PostgreSql11JdbcIndexedSessionRepositoryITests extends AbstractContainerJd
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public PostgreSQLContainer databaseContainer() {
|
||||
PostgreSQLContainer databaseContainer() {
|
||||
PostgreSQLContainer databaseContainer = DatabaseContainers.postgreSql11();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.postgreSql();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,14 +41,14 @@ class PostgreSql9JdbcIndexedSessionRepositoryITests extends AbstractContainerJdb
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public PostgreSQLContainer databaseContainer() {
|
||||
PostgreSQLContainer databaseContainer() {
|
||||
PostgreSQLContainer databaseContainer = DatabaseContainers.postgreSql9();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.postgreSql();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,14 +41,14 @@ class SqlServerJdbcIndexedSessionRepositoryITests extends AbstractContainerJdbcI
|
||||
static class Config extends BaseContainerConfig {
|
||||
|
||||
@Bean
|
||||
public MSSQLServerContainer databaseContainer() {
|
||||
MSSQLServerContainer databaseContainer() {
|
||||
MSSQLServerContainer databaseContainer = DatabaseContainers.sqlServer2017();
|
||||
databaseContainer.start();
|
||||
return databaseContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResourceDatabasePopulator databasePopulator() {
|
||||
ResourceDatabasePopulator databasePopulator() {
|
||||
return DatabasePopulators.sqlServer();
|
||||
}
|
||||
|
||||
|
||||
@@ -310,12 +310,12 @@ class JdbcHttpSessionConfigurationTests {
|
||||
static class DataSourceConfiguration {
|
||||
|
||||
@Bean
|
||||
public DataSource defaultDataSource() {
|
||||
DataSource defaultDataSource() {
|
||||
return mock(DataSource.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PlatformTransactionManager transactionManager() {
|
||||
PlatformTransactionManager transactionManager() {
|
||||
return mock(PlatformTransactionManager.class);
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SpringSessionDataSource
|
||||
public DataSource qualifiedDataSource() {
|
||||
DataSource qualifiedDataSource() {
|
||||
return mock(DataSource.class);
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public DataSource primaryDataSource() {
|
||||
DataSource primaryDataSource() {
|
||||
return mock(DataSource.class);
|
||||
}
|
||||
|
||||
@@ -423,13 +423,13 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SpringSessionDataSource
|
||||
public DataSource qualifiedDataSource() {
|
||||
DataSource qualifiedDataSource() {
|
||||
return mock(DataSource.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public DataSource primaryDataSource() {
|
||||
DataSource primaryDataSource() {
|
||||
return mock(DataSource.class);
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
static class NamedDataSourceConfiguration {
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
DataSource dataSource() {
|
||||
return mock(DataSource.class);
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
static class MultipleDataSourceConfiguration {
|
||||
|
||||
@Bean
|
||||
public DataSource secondaryDataSource() {
|
||||
DataSource secondaryDataSource() {
|
||||
return mock(DataSource.class);
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
static class CustomTransactionOperationsConfiguration {
|
||||
|
||||
@Bean
|
||||
public TransactionOperations springSessionTransactionOperations() {
|
||||
TransactionOperations springSessionTransactionOperations() {
|
||||
return TransactionOperations.withoutTransaction();
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@SuppressWarnings("unchecked")
|
||||
public IndexResolver<Session> indexResolver() {
|
||||
IndexResolver<Session> indexResolver() {
|
||||
return mock(IndexResolver.class);
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
static class CustomLobHandlerConfiguration {
|
||||
|
||||
@Bean
|
||||
public LobHandler springSessionLobHandler() {
|
||||
LobHandler springSessionLobHandler() {
|
||||
return mock(LobHandler.class);
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
static class CustomConversionServiceConfiguration {
|
||||
|
||||
@Bean
|
||||
public ConversionService springSessionConversionService() {
|
||||
ConversionService springSessionConversionService() {
|
||||
return mock(ConversionService.class);
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
static class CustomJdbcHttpSessionConfiguration {
|
||||
|
||||
@Bean
|
||||
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
return new PropertySourcesPlaceholderConfigurer();
|
||||
}
|
||||
|
||||
@@ -511,13 +511,13 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
@Bean
|
||||
@Order(0)
|
||||
public SessionRepositoryCustomizer<JdbcIndexedSessionRepository> sessionRepositoryCustomizerOne() {
|
||||
SessionRepositoryCustomizer<JdbcIndexedSessionRepository> sessionRepositoryCustomizerOne() {
|
||||
return (sessionRepository) -> sessionRepository.setDefaultMaxInactiveInterval(0);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(1)
|
||||
public SessionRepositoryCustomizer<JdbcIndexedSessionRepository> sessionRepositoryCustomizerTwo() {
|
||||
SessionRepositoryCustomizer<JdbcIndexedSessionRepository> sessionRepositoryCustomizerTwo() {
|
||||
return (sessionRepository) -> sessionRepository
|
||||
.setDefaultMaxInactiveInterval(MAX_INACTIVE_INTERVAL_IN_SECONDS);
|
||||
}
|
||||
|
||||
@@ -83,14 +83,14 @@ class FindByUsernameTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
|
||||
redisContainer.start();
|
||||
return redisContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@@ -107,14 +107,14 @@ class HttpRedisJsonTest {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
|
||||
redisContainer.start();
|
||||
return redisContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@@ -56,14 +56,14 @@ class RedisSerializerTest {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
|
||||
redisContainer.start();
|
||||
return redisContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@@ -85,14 +85,14 @@ class BootTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
|
||||
redisContainer.start();
|
||||
return redisContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@@ -89,14 +89,14 @@ class BootTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
|
||||
redisContainer.start();
|
||||
return redisContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@@ -97,14 +97,14 @@ class AttributeTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
|
||||
redisContainer.start();
|
||||
return redisContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@@ -78,14 +78,14 @@ class ApplicationTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
|
||||
redisContainer.start();
|
||||
return redisContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@@ -91,20 +91,20 @@ class RestMockMvcTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer() {
|
||||
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
|
||||
redisContainer.start();
|
||||
return redisContainer;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HttpSessionIdResolver httpSessionIdResolver() {
|
||||
HttpSessionIdResolver httpSessionIdResolver() {
|
||||
return HeaderHttpSessionIdResolver.xAuthToken();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user