Remove @Configuration meta-annotation from @Enable*Session annotations
Closes gh-1361
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2020 the original author or authors.
|
||||
* Copyright 2014-2022 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.
|
||||
@@ -31,6 +31,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
@@ -827,6 +828,7 @@ abstract class AbstractJdbcIndexedSessionRepositoryITests {
|
||||
return this.changedContext.getAuthentication().getName();
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class BaseConfig {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2022 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.
|
||||
@@ -24,7 +24,6 @@ import java.lang.annotation.Target;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.session.FlushMode;
|
||||
import org.springframework.session.MapSession;
|
||||
@@ -42,7 +41,7 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
|
||||
* {@link DataSource} must be provided. For example:
|
||||
*
|
||||
* <pre class="code">
|
||||
* @Configuration
|
||||
* @Configuration(proxyBeanMethods = false)
|
||||
* @EnableJdbcHttpSession
|
||||
* public class JdbcHttpSessionConfig {
|
||||
*
|
||||
@@ -77,7 +76,6 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
|
||||
@Target(ElementType.TYPE)
|
||||
@Documented
|
||||
@Import(JdbcHttpSessionConfiguration.class)
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public @interface EnableJdbcHttpSession {
|
||||
|
||||
/**
|
||||
|
||||
@@ -317,6 +317,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
this.context.refresh();
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class NoDataSourceConfiguration {
|
||||
|
||||
@@ -337,11 +338,13 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class DefaultConfiguration {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession(tableName = TABLE_NAME)
|
||||
static class CustomTableNameAnnotationConfiguration {
|
||||
|
||||
@@ -356,6 +359,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession(maxInactiveIntervalInSeconds = MAX_INACTIVE_INTERVAL_IN_SECONDS)
|
||||
static class CustomMaxInactiveIntervalInSecondsAnnotationConfiguration {
|
||||
|
||||
@@ -370,6 +374,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession(cleanupCron = CLEANUP_CRON_EXPRESSION)
|
||||
static class CustomCleanupCronExpressionAnnotationConfiguration {
|
||||
|
||||
@@ -384,6 +389,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession(flushMode = FlushMode.IMMEDIATE)
|
||||
static class CustomFlushModeExpressionAnnotationConfiguration {
|
||||
|
||||
@@ -398,6 +404,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession(saveMode = SaveMode.ALWAYS)
|
||||
static class CustomSaveModeExpressionAnnotationConfiguration {
|
||||
|
||||
@@ -412,6 +419,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class QualifiedDataSourceConfiguration {
|
||||
|
||||
@@ -423,6 +431,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class PrimaryDataSourceConfiguration {
|
||||
|
||||
@@ -434,6 +443,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class QualifiedAndPrimaryDataSourceConfiguration {
|
||||
|
||||
@@ -451,6 +461,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class NamedDataSourceConfiguration {
|
||||
|
||||
@@ -461,6 +472,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class MultipleDataSourceConfiguration {
|
||||
|
||||
@@ -471,6 +483,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class CustomTransactionOperationsConfiguration {
|
||||
|
||||
@@ -481,6 +494,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class CustomIndexResolverConfiguration {
|
||||
|
||||
@@ -492,6 +506,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class CustomLobHandlerConfiguration {
|
||||
|
||||
@@ -502,6 +517,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class CustomConversionServiceConfiguration {
|
||||
|
||||
@@ -512,6 +528,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession(tableName = "${session.jdbc.tableName}")
|
||||
static class CustomJdbcHttpSessionConfiguration {
|
||||
|
||||
@@ -522,6 +539,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableJdbcHttpSession
|
||||
static class SessionRepositoryCustomizerConfiguration {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user