Browse Source

Make fields final

Closes gh-33537
pull/33545/head
Moritz Halbritter 3 years ago
parent
commit
725337f976
  1. 2
      buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeBom.java
  2. 2
      buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PrepareMavenBinaries.java
  3. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointProperties.java
  4. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/env/EnvironmentEndpointProperties.java
  5. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/quartz/QuartzEndpointProperties.java
  6. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesAutoConfigurationTests.java
  7. 3
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupTests.java
  8. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupsPostProcessorTests.java
  9. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryEndpointFilterTests.java
  10. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java
  11. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java
  12. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/jackson/JacksonEndpointAutoConfigurationTests.java
  13. 6
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryPostProcessorTests.java
  14. 5
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/MetricsRepositoryMethodInvocationListenerBeanPostProcessorTests.java
  15. 6
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/client/ClientHttpObservationConventionAdapterTests.java
  16. 9
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/client/ClientObservationConventionAdapterTests.java
  17. 9
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/servlet/ServerRequestObservationConventionAdapterTests.java
  18. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolverTests.java
  19. 4
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java
  20. 2
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java
  21. 6
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java
  22. 8
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java
  23. 2
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManager.java
  24. 2
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthenticationAuditListener.java
  25. 4
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointSerializationTests.java
  26. 4
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java
  27. 11
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameterTests.java
  28. 4
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParametersTests.java
  29. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java
  30. 4
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java
  31. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapperTests.java
  32. 4
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java
  33. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/MBeanInfoFactoryTests.java
  34. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactoryTests.java
  35. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/AbstractHealthIndicatorTests.java
  36. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/HeapDumpWebEndpointWebIntegrationTests.java
  37. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/MetricsEndpointWebIntegrationTests.java
  38. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/data/DefaultRepositoryTagsProviderTests.java
  39. 4
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java
  40. 6
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/client/ObservationRestTemplateCustomizerTests.java
  41. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/DefaultWebClientExchangeTagsProviderTests.java
  42. 10
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/ObservationWebClientCustomizerTests.java
  43. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java
  44. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitTemplateConfigurer.java
  45. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnJndiCondition.java
  46. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceAutoConfiguration.java
  47. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/servlet/GraphQlWebMvcAutoConfiguration.java
  48. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapProperties.java
  49. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportMessage.java
  50. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailProperties.java
  51. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java
  52. 4
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
  53. 4
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java
  54. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AbstractDependsOnBeanFactoryPostProcessorTests.java
  55. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java
  56. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBeanTests.java
  57. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnJndiTests.java
  58. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBeanTests.java
  59. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnPropertyTests.java
  60. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java
  61. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/city/City.java
  62. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/country/Country.java
  63. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java
  64. 3
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/GraphQlTestDataFetchers.java
  65. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAutoConfigurationTests.java
  66. 6
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAvailabilityProviderTests.java
  67. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/gson/GsonAutoConfigurationTests.java
  68. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java
  69. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceJsonSerializationTests.java
  70. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/ParentAwareNamingStrategyTests.java
  71. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java
  72. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java
  73. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityPropertiesTests.java
  74. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesTests.java
  75. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java
  76. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java
  77. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java
  78. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/sql/init/SqlInitializationAutoConfigurationTests.java
  79. 6
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java
  80. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java
  81. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapterTests.java
  82. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryCustomizerTests.java
  83. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageIntegrationTests.java
  84. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolverTests.java
  85. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/RemappedErrorViewIntegrationTests.java
  86. 6
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java
  87. 4
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsProperties.java
  88. 4
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsProperties.java
  89. 2
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcher.java
  90. 2
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/DirectorySnapshot.java
  91. 2
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java
  92. 2
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/RemoteClientConfiguration.java
  93. 2
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
  94. 2
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/HttpTunnelConnection.java
  95. 4
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServer.java
  96. 2
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerHandler.java
  97. 2
      spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathChangedEventTests.java
  98. 2
      spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java
  99. 2
      spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java
  100. 6
      spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java
  101. Some files were not shown because too many files have changed in this diff Show More

2
buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeBom.java

@ -58,7 +58,7 @@ import org.springframework.util.StringUtils; @@ -58,7 +58,7 @@ import org.springframework.util.StringUtils;
*/
public class UpgradeBom extends DefaultTask {
private Set<String> repositoryUrls;
private final Set<String> repositoryUrls;
private final BomExtension bom;

2
buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PrepareMavenBinaries.java

@ -35,7 +35,7 @@ import org.gradle.api.tasks.TaskAction; @@ -35,7 +35,7 @@ import org.gradle.api.tasks.TaskAction;
*/
public class PrepareMavenBinaries extends DefaultTask {
private Set<String> versions = new LinkedHashSet<>();
private final Set<String> versions = new LinkedHashSet<>();
private File outputDir;

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointProperties.java

@ -42,7 +42,7 @@ public class ConfigurationPropertiesReportEndpointProperties { @@ -42,7 +42,7 @@ public class ConfigurationPropertiesReportEndpointProperties {
* Roles used to determine whether a user is authorized to be shown unsanitized
* values. When empty, all authenticated users are authorized.
*/
private Set<String> roles = new HashSet<>();
private final Set<String> roles = new HashSet<>();
public Show getShowValues() {
return this.showValues;

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/env/EnvironmentEndpointProperties.java vendored

@ -41,7 +41,7 @@ public class EnvironmentEndpointProperties { @@ -41,7 +41,7 @@ public class EnvironmentEndpointProperties {
* Roles used to determine whether a user is authorized to be shown unsanitized
* values. When empty, all authenticated users are authorized.
*/
private Set<String> roles = new HashSet<>();
private final Set<String> roles = new HashSet<>();
public Show getShowValues() {
return this.showValues;

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/quartz/QuartzEndpointProperties.java

@ -41,7 +41,7 @@ public class QuartzEndpointProperties { @@ -41,7 +41,7 @@ public class QuartzEndpointProperties {
* Roles used to determine whether a user is authorized to be shown unsanitized job or
* trigger values. When empty, all authenticated users are authorized.
*/
private Set<String> roles = new HashSet<>();
private final Set<String> roles = new HashSet<>();
public Show getShowValues() {
return this.showValues;

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesAutoConfigurationTests.java

@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class AvailabilityProbesAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ApplicationAvailabilityAutoConfiguration.class,
AvailabilityHealthContributorAutoConfiguration.class, AvailabilityProbesAutoConfiguration.class));

3
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupTests.java

@ -32,7 +32,8 @@ import static org.mockito.Mockito.mock; @@ -32,7 +32,8 @@ import static org.mockito.Mockito.mock;
*/
class AvailabilityProbesHealthEndpointGroupTests {
private AvailabilityProbesHealthEndpointGroup group = new AvailabilityProbesHealthEndpointGroup(null, "a", "b");
private final AvailabilityProbesHealthEndpointGroup group = new AvailabilityProbesHealthEndpointGroup(null, "a",
"b");
@Test
void isMemberWhenMemberReturnsTrue() {

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupsPostProcessorTests.java

@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock; @@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
*/
class AvailabilityProbesHealthEndpointGroupsPostProcessorTests {
private AvailabilityProbesHealthEndpointGroupsPostProcessor postProcessor = new AvailabilityProbesHealthEndpointGroupsPostProcessor(
private final AvailabilityProbesHealthEndpointGroupsPostProcessor postProcessor = new AvailabilityProbesHealthEndpointGroupsPostProcessor(
new MockEnvironment());
@Test

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryEndpointFilterTests.java

@ -31,7 +31,7 @@ import static org.mockito.Mockito.mock; @@ -31,7 +31,7 @@ import static org.mockito.Mockito.mock;
*/
class CloudFoundryEndpointFilterTests {
private CloudFoundryEndpointFilter filter = new CloudFoundryEndpointFilter();
private final CloudFoundryEndpointFilter filter = new CloudFoundryEndpointFilter();
@Test
void matchIfDiscovererCloudFoundryShouldReturnFalse() {

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java

@ -71,9 +71,9 @@ import static org.mockito.Mockito.mock; @@ -71,9 +71,9 @@ import static org.mockito.Mockito.mock;
*/
class CloudFoundryWebFluxEndpointIntegrationTests {
private static ReactiveTokenValidator tokenValidator = mock(ReactiveTokenValidator.class);
private static final ReactiveTokenValidator tokenValidator = mock(ReactiveTokenValidator.class);
private static ReactiveCloudFoundrySecurityService securityService = mock(
private static final ReactiveCloudFoundrySecurityService securityService = mock(
ReactiveCloudFoundrySecurityService.class);
private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java

@ -66,9 +66,9 @@ import static org.mockito.Mockito.mock; @@ -66,9 +66,9 @@ import static org.mockito.Mockito.mock;
*/
class CloudFoundryMvcWebEndpointIntegrationTests {
private static TokenValidator tokenValidator = mock(TokenValidator.class);
private static final TokenValidator tokenValidator = mock(TokenValidator.class);
private static CloudFoundrySecurityService securityService = mock(CloudFoundrySecurityService.class);
private static final CloudFoundrySecurityService securityService = mock(CloudFoundrySecurityService.class);
@Test
void operationWithSecurityInterceptorForbidden() {

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/jackson/JacksonEndpointAutoConfigurationTests.java

@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class JacksonEndpointAutoConfigurationTests {
private ApplicationContextRunner runner = new ApplicationContextRunner()
private final ApplicationContextRunner runner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(JacksonEndpointAutoConfiguration.class));
@Test

6
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryPostProcessorTests.java

@ -50,11 +50,11 @@ class MeterRegistryPostProcessorTests { @@ -50,11 +50,11 @@ class MeterRegistryPostProcessorTests {
private final MetricsProperties properties = new MetricsProperties();
private List<MeterRegistryCustomizer<?>> customizers = new ArrayList<>();
private final List<MeterRegistryCustomizer<?>> customizers = new ArrayList<>();
private List<MeterFilter> filters = new ArrayList<>();
private final List<MeterFilter> filters = new ArrayList<>();
private List<MeterBinder> binders = new ArrayList<>();
private final List<MeterBinder> binders = new ArrayList<>();
@Mock
private MeterRegistryCustomizer<MeterRegistry> mockCustomizer;

5
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/MetricsRepositoryMethodInvocationListenerBeanPostProcessorTests.java

@ -36,9 +36,10 @@ import static org.mockito.Mockito.mock; @@ -36,9 +36,10 @@ import static org.mockito.Mockito.mock;
*/
class MetricsRepositoryMethodInvocationListenerBeanPostProcessorTests {
private MetricsRepositoryMethodInvocationListener listener = mock(MetricsRepositoryMethodInvocationListener.class);
private final MetricsRepositoryMethodInvocationListener listener = mock(
MetricsRepositoryMethodInvocationListener.class);
private MetricsRepositoryMethodInvocationListenerBeanPostProcessor postProcessor = new MetricsRepositoryMethodInvocationListenerBeanPostProcessor(
private final MetricsRepositoryMethodInvocationListenerBeanPostProcessor postProcessor = new MetricsRepositoryMethodInvocationListenerBeanPostProcessor(
SingletonSupplier.of(this.listener));
@Test

6
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/client/ClientHttpObservationConventionAdapterTests.java

@ -44,12 +44,12 @@ class ClientHttpObservationConventionAdapterTests { @@ -44,12 +44,12 @@ class ClientHttpObservationConventionAdapterTests {
private static final String TEST_METRIC_NAME = "test.metric.name";
private ClientHttpObservationConventionAdapter convention = new ClientHttpObservationConventionAdapter(
private final ClientHttpObservationConventionAdapter convention = new ClientHttpObservationConventionAdapter(
TEST_METRIC_NAME, new DefaultRestTemplateExchangeTagsProvider());
private ClientHttpRequest request = new MockClientHttpRequest(HttpMethod.GET, URI.create("/resource/test"));
private final ClientHttpRequest request = new MockClientHttpRequest(HttpMethod.GET, URI.create("/resource/test"));
private ClientHttpResponse response = new MockClientHttpResponse("foo".getBytes(), HttpStatus.OK);
private final ClientHttpResponse response = new MockClientHttpResponse("foo".getBytes(), HttpStatus.OK);
private ClientRequestObservationContext context;

9
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/client/ClientObservationConventionAdapterTests.java

@ -43,13 +43,14 @@ class ClientObservationConventionAdapterTests { @@ -43,13 +43,14 @@ class ClientObservationConventionAdapterTests {
private static final String TEST_METRIC_NAME = "test.metric.name";
private ClientObservationConventionAdapter convention = new ClientObservationConventionAdapter(TEST_METRIC_NAME,
new DefaultWebClientExchangeTagsProvider());
private final ClientObservationConventionAdapter convention = new ClientObservationConventionAdapter(
TEST_METRIC_NAME, new DefaultWebClientExchangeTagsProvider());
private ClientRequest.Builder requestBuilder = ClientRequest.create(HttpMethod.GET, URI.create("/resource/test"))
private final ClientRequest.Builder requestBuilder = ClientRequest
.create(HttpMethod.GET, URI.create("/resource/test"))
.attribute(WebClient.class.getName() + ".uriTemplate", "/resource/{name}");
private ClientResponse response = ClientResponse.create(HttpStatus.OK).body("foo").build();
private final ClientResponse response = ClientResponse.create(HttpStatus.OK).body("foo").build();
private ClientRequestObservationContext context;

9
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/servlet/ServerRequestObservationConventionAdapterTests.java

@ -47,14 +47,15 @@ class ServerRequestObservationConventionAdapterTests { @@ -47,14 +47,15 @@ class ServerRequestObservationConventionAdapterTests {
private static final String TEST_METRIC_NAME = "test.metric.name";
private ServerRequestObservationConventionAdapter convention = new ServerRequestObservationConventionAdapter(
private final ServerRequestObservationConventionAdapter convention = new ServerRequestObservationConventionAdapter(
TEST_METRIC_NAME, new DefaultWebMvcTagsProvider(), Collections.emptyList());
private MockHttpServletRequest request = new MockHttpServletRequest("GET", "/resource/test");
private final MockHttpServletRequest request = new MockHttpServletRequest("GET", "/resource/test");
private MockHttpServletResponse response = new MockHttpServletResponse();
private final MockHttpServletResponse response = new MockHttpServletResponse();
private ServerRequestObservationContext context = new ServerRequestObservationContext(this.request, this.response);
private final ServerRequestObservationContext context = new ServerRequestObservationContext(this.request,
this.response);
@Test
void customNameIsUsed() {

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolverTests.java

@ -43,9 +43,9 @@ class CompositeHandlerExceptionResolverTests { @@ -43,9 +43,9 @@ class CompositeHandlerExceptionResolverTests {
private AnnotationConfigApplicationContext context;
private MockHttpServletRequest request = new MockHttpServletRequest();
private final MockHttpServletRequest request = new MockHttpServletRequest();
private MockHttpServletResponse response = new MockHttpServletResponse();
private final MockHttpServletResponse response = new MockHttpServletResponse();
@Test
void resolverShouldDelegateToOtherResolversInContext() {

4
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java

@ -401,11 +401,11 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten @@ -401,11 +401,11 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
private final EndpointId id;
private boolean enabledByDefault;
private final boolean enabledByDefault;
private final Class<?> filter;
private Set<ExtensionBean> extensions = new LinkedHashSet<>();
private final Set<ExtensionBean> extensions = new LinkedHashSet<>();
EndpointBean(Environment environment, String beanName, Class<?> beanType, Supplier<Object> beanSupplier) {
MergedAnnotation<Endpoint> annotation = MergedAnnotations.from(beanType, SearchStrategy.TYPE_HIERARCHY)

2
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java

@ -190,7 +190,7 @@ public final class Health extends HealthComponent { @@ -190,7 +190,7 @@ public final class Health extends HealthComponent {
private Status status;
private Map<String, Object> details;
private final Map<String, Object> details;
private Throwable exception;

6
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java

@ -161,7 +161,7 @@ public class LoggersEndpoint { @@ -161,7 +161,7 @@ public class LoggersEndpoint {
*/
public static class LoggerLevelsDescriptor implements OperationResponseBody {
private String configuredLevel;
private final String configuredLevel;
public LoggerLevelsDescriptor(LogLevel configuredLevel) {
this.configuredLevel = getName(configuredLevel);
@ -182,7 +182,7 @@ public class LoggersEndpoint { @@ -182,7 +182,7 @@ public class LoggersEndpoint {
*/
public static class GroupLoggerLevelsDescriptor extends LoggerLevelsDescriptor {
private List<String> members;
private final List<String> members;
public GroupLoggerLevelsDescriptor(LogLevel configuredLevel, List<String> members) {
super(configuredLevel);
@ -200,7 +200,7 @@ public class LoggersEndpoint { @@ -200,7 +200,7 @@ public class LoggersEndpoint {
*/
public static class SingleLoggerLevelsDescriptor extends LoggerLevelsDescriptor {
private String effectiveLevel;
private final String effectiveLevel;
public SingleLoggerLevelsDescriptor(LoggerConfiguration configuration) {
super(configuration.getConfiguredLevel());

8
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java

@ -146,9 +146,9 @@ public class HeapDumpWebEndpoint { @@ -146,9 +146,9 @@ public class HeapDumpWebEndpoint {
*/
protected static class HotSpotDiagnosticMXBeanHeapDumper implements HeapDumper {
private Object diagnosticMXBean;
private final Object diagnosticMXBean;
private Method dumpHeapMethod;
private final Method dumpHeapMethod;
@SuppressWarnings("unchecked")
protected HotSpotDiagnosticMXBeanHeapDumper() {
@ -189,9 +189,9 @@ public class HeapDumpWebEndpoint { @@ -189,9 +189,9 @@ public class HeapDumpWebEndpoint {
*/
private static final class OpenJ9DiagnosticsMXBeanHeapDumper implements HeapDumper {
private Object diagnosticMXBean;
private final Object diagnosticMXBean;
private Method dumpHeapMethod;
private final Method dumpHeapMethod;
@SuppressWarnings("unchecked")
private OpenJ9DiagnosticsMXBeanHeapDumper() {

2
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManager.java

@ -56,7 +56,7 @@ public class PrometheusPushGatewayManager { @@ -56,7 +56,7 @@ public class PrometheusPushGatewayManager {
private final TaskScheduler scheduler;
private ScheduledFuture<?> scheduled;
private final ScheduledFuture<?> scheduled;
/**
* Create a new {@link PrometheusPushGatewayManager} instance using a single threaded

2
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthenticationAuditListener.java

@ -53,7 +53,7 @@ public class AuthenticationAuditListener extends AbstractAuthenticationAuditList @@ -53,7 +53,7 @@ public class AuthenticationAuditListener extends AbstractAuthenticationAuditList
private static final String WEB_LISTENER_CHECK_CLASS = "org.springframework.security.web.authentication.switchuser.AuthenticationSwitchUserEvent";
private WebAuditListener webListener = maybeCreateWebListener();
private final WebAuditListener webListener = maybeCreateWebListener();
private static WebAuditListener maybeCreateWebListener() {
if (ClassUtils.isPresent(WEB_LISTENER_CHECK_CLASS, null)) {

4
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointSerializationTests.java

@ -497,9 +497,9 @@ class ConfigurationPropertiesReportEndpointSerializationTests { @@ -497,9 +497,9 @@ class ConfigurationPropertiesReportEndpointSerializationTests {
public static class InitializedMapAndListProperties extends Foo {
private Map<String, Boolean> map = new HashMap<>();
private final Map<String, Boolean> map = new HashMap<>();
private List<String> list = new ArrayList<>();
private final List<String> list = new ArrayList<>();
public Map<String, Boolean> getMap() {
return this.map;

4
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java

@ -435,7 +435,7 @@ class ConfigurationPropertiesReportEndpointTests { @@ -435,7 +435,7 @@ class ConfigurationPropertiesReportEndpointTests {
private Duration duration = Duration.ofSeconds(10);
private String ignored = "dummy";
private final String ignored = "dummy";
public String getDbPassword() {
return this.dbPassword;
@ -803,7 +803,7 @@ class ConfigurationPropertiesReportEndpointTests { @@ -803,7 +803,7 @@ class ConfigurationPropertiesReportEndpointTests {
private URI noPasswordUri = URI.create("http://user:@localhost:8080");
private List<String> simpleList = new ArrayList<>();
private final List<String> simpleList = new ArrayList<>();
private String rawSensitiveAddresses = "http://user:password@localhost:8080,http://user2:password2@localhost:8082";

11
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameterTests.java

@ -38,16 +38,17 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -38,16 +38,17 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class OperationMethodParameterTests {
private Method example = ReflectionUtils.findMethod(getClass(), "example", String.class, String.class);
private final Method example = ReflectionUtils.findMethod(getClass(), "example", String.class, String.class);
private Method exampleJsr305 = ReflectionUtils.findMethod(getClass(), "exampleJsr305", String.class, String.class);
private Method exampleMetaJsr305 = ReflectionUtils.findMethod(getClass(), "exampleMetaJsr305", String.class,
private final Method exampleJsr305 = ReflectionUtils.findMethod(getClass(), "exampleJsr305", String.class,
String.class);
private Method exampleJsr305NonNull = ReflectionUtils.findMethod(getClass(), "exampleJsr305NonNull", String.class,
private final Method exampleMetaJsr305 = ReflectionUtils.findMethod(getClass(), "exampleMetaJsr305", String.class,
String.class);
private final Method exampleJsr305NonNull = ReflectionUtils.findMethod(getClass(), "exampleJsr305NonNull",
String.class, String.class);
@Test
void getNameShouldReturnName() {
OperationMethodParameter parameter = new OperationMethodParameter("name", this.example.getParameters()[0]);

4
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParametersTests.java

@ -43,9 +43,9 @@ import static org.mockito.Mockito.mock; @@ -43,9 +43,9 @@ import static org.mockito.Mockito.mock;
*/
class OperationMethodParametersTests {
private Method exampleMethod = ReflectionUtils.findMethod(getClass(), "example", String.class);
private final Method exampleMethod = ReflectionUtils.findMethod(getClass(), "example", String.class);
private Method exampleNoParamsMethod = ReflectionUtils.findMethod(getClass(), "exampleNoParams");
private final Method exampleNoParamsMethod = ReflectionUtils.findMethod(getClass(), "exampleNoParams");
@Test
void createWhenMethodIsNullShouldThrowException() {

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java

@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException @@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
*/
class OperationMethodTests {
private Method exampleMethod = ReflectionUtils.findMethod(getClass(), "example", String.class);
private final Method exampleMethod = ReflectionUtils.findMethod(getClass(), "example", String.class);
@Test
void createWhenMethodIsNullShouldThrowException() {

4
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java

@ -54,9 +54,9 @@ class EndpointMBeanTests { @@ -54,9 +54,9 @@ class EndpointMBeanTests {
private static final String[] NO_SIGNATURE = {};
private TestExposableJmxEndpoint endpoint = new TestExposableJmxEndpoint(new TestJmxOperation());
private final TestExposableJmxEndpoint endpoint = new TestExposableJmxEndpoint(new TestJmxOperation());
private TestJmxOperationResponseMapper responseMapper = new TestJmxOperationResponseMapper();
private final TestJmxOperationResponseMapper responseMapper = new TestJmxOperationResponseMapper();
@Test
void createWhenResponseMapperIsNullShouldThrowException() {

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapperTests.java

@ -42,7 +42,7 @@ import static org.mockito.Mockito.spy; @@ -42,7 +42,7 @@ import static org.mockito.Mockito.spy;
*/
class JacksonJmxOperationResponseMapperTests {
private JacksonJmxOperationResponseMapper mapper = new JacksonJmxOperationResponseMapper(null);
private final JacksonJmxOperationResponseMapper mapper = new JacksonJmxOperationResponseMapper(null);
private final BasicJsonTester json = new BasicJsonTester(getClass());

4
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java

@ -61,9 +61,9 @@ class JmxEndpointExporterTests { @@ -61,9 +61,9 @@ class JmxEndpointExporterTests {
@Spy
private EndpointObjectNameFactory objectNameFactory = new TestEndpointObjectNameFactory();
private JmxOperationResponseMapper responseMapper = new TestJmxOperationResponseMapper();
private final JmxOperationResponseMapper responseMapper = new TestJmxOperationResponseMapper();
private List<ExposableJmxEndpoint> endpoints = new ArrayList<>();
private final List<ExposableJmxEndpoint> endpoints = new ArrayList<>();
@Captor
private ArgumentCaptor<Object> objectCaptor;

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/MBeanInfoFactoryTests.java

@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock;
*/
class MBeanInfoFactoryTests {
private MBeanInfoFactory factory = new MBeanInfoFactory(new TestJmxOperationResponseMapper());
private final MBeanInfoFactory factory = new MBeanInfoFactory(new TestJmxOperationResponseMapper());
@Test
void getMBeanInfoShouldReturnMBeanInfo() {

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactoryTests.java

@ -42,7 +42,7 @@ class RequestPredicateFactoryTests { @@ -42,7 +42,7 @@ class RequestPredicateFactoryTests {
private final RequestPredicateFactory factory = new RequestPredicateFactory(
new EndpointMediaTypes(Collections.emptyList(), Collections.emptyList()));
private String rootPath = "/root";
private final String rootPath = "/root";
@Test
void getRequestPredicateWhenHasMoreThanOneMatchAllThrowsException() {

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/AbstractHealthIndicatorTests.java

@ -94,7 +94,7 @@ class AbstractHealthIndicatorTests { @@ -94,7 +94,7 @@ class AbstractHealthIndicatorTests {
static class TestHealthIndicator extends AbstractHealthIndicator {
private Consumer<Builder> action;
private final Consumer<Builder> action;
TestHealthIndicator(String message, Consumer<Builder> action) {
super(message);

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/HeapDumpWebEndpointWebIntegrationTests.java

@ -83,7 +83,7 @@ class HeapDumpWebEndpointWebIntegrationTests { @@ -83,7 +83,7 @@ class HeapDumpWebEndpointWebIntegrationTests {
private boolean available;
private String heapDump = "HEAPDUMP";
private final String heapDump = "HEAPDUMP";
private File file;

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/MetricsEndpointWebIntegrationTests.java

@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class MetricsEndpointWebIntegrationTests {
private static MeterRegistry registry = new SimpleMeterRegistry(SimpleConfig.DEFAULT, new MockClock());
private static final MeterRegistry registry = new SimpleMeterRegistry(SimpleConfig.DEFAULT, new MockClock());
private final ObjectMapper mapper = new ObjectMapper();

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/data/DefaultRepositoryTagsProviderTests.java

@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock;
*/
class DefaultRepositoryTagsProviderTests {
private DefaultRepositoryTagsProvider provider = new DefaultRepositoryTagsProvider();
private final DefaultRepositoryTagsProvider provider = new DefaultRepositoryTagsProvider();
@Test
void repositoryTagsIncludesRepository() {

4
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java

@ -61,9 +61,9 @@ class PrometheusPushGatewayManagerTests { @@ -61,9 +61,9 @@ class PrometheusPushGatewayManagerTests {
@Mock
private TaskScheduler scheduler;
private Duration pushRate = Duration.ofSeconds(1);
private final Duration pushRate = Duration.ofSeconds(1);
private Map<String, String> groupingKey = Collections.singletonMap("foo", "bar");
private final Map<String, String> groupingKey = Collections.singletonMap("foo", "bar");
@Captor
private ArgumentCaptor<Runnable> task;

6
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/client/ObservationRestTemplateCustomizerTests.java

@ -34,11 +34,11 @@ class ObservationRestTemplateCustomizerTests { @@ -34,11 +34,11 @@ class ObservationRestTemplateCustomizerTests {
private static final String TEST_METRIC_NAME = "http.test.metric.name";
private ObservationRegistry observationRegistry = TestObservationRegistry.create();
private final ObservationRegistry observationRegistry = TestObservationRegistry.create();
private RestTemplate restTemplate = new RestTemplate();
private final RestTemplate restTemplate = new RestTemplate();
private ObservationRestTemplateCustomizer customizer = new ObservationRestTemplateCustomizer(
private final ObservationRestTemplateCustomizer customizer = new ObservationRestTemplateCustomizer(
this.observationRegistry, new DefaultClientRequestObservationConvention(TEST_METRIC_NAME));
@Test

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/DefaultWebClientExchangeTagsProviderTests.java

@ -44,7 +44,7 @@ class DefaultWebClientExchangeTagsProviderTests { @@ -44,7 +44,7 @@ class DefaultWebClientExchangeTagsProviderTests {
private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate";
private WebClientExchangeTagsProvider tagsProvider = new DefaultWebClientExchangeTagsProvider();
private final WebClientExchangeTagsProvider tagsProvider = new DefaultWebClientExchangeTagsProvider();
private ClientRequest request;

10
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/ObservationWebClientCustomizerTests.java

@ -34,15 +34,15 @@ class ObservationWebClientCustomizerTests { @@ -34,15 +34,15 @@ class ObservationWebClientCustomizerTests {
private static final String TEST_METRIC_NAME = "http.test.metric.name";
private TestObservationRegistry observationRegistry = TestObservationRegistry.create();
private final TestObservationRegistry observationRegistry = TestObservationRegistry.create();
private ClientRequestObservationConvention observationConvention = new DefaultClientRequestObservationConvention(
private final ClientRequestObservationConvention observationConvention = new DefaultClientRequestObservationConvention(
TEST_METRIC_NAME);
private ObservationWebClientCustomizer customizer = new ObservationWebClientCustomizer(this.observationRegistry,
this.observationConvention);
private final ObservationWebClientCustomizer customizer = new ObservationWebClientCustomizer(
this.observationRegistry, this.observationConvention);
private WebClient.Builder clientBuilder = WebClient.builder();
private final WebClient.Builder clientBuilder = WebClient.builder();
@Test
void shouldCustomizeObservationConfiguration() {

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java

@ -45,7 +45,7 @@ public abstract class AbstractRabbitListenerContainerFactoryConfigurer<T extends @@ -45,7 +45,7 @@ public abstract class AbstractRabbitListenerContainerFactoryConfigurer<T extends
private List<RabbitRetryTemplateCustomizer> retryTemplateCustomizers;
private RabbitProperties rabbitProperties;
private final RabbitProperties rabbitProperties;
/**
* Creates a new configurer that will use the given {@code rabbitProperties}.

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitTemplateConfigurer.java

@ -37,7 +37,7 @@ public class RabbitTemplateConfigurer { @@ -37,7 +37,7 @@ public class RabbitTemplateConfigurer {
private List<RabbitRetryTemplateCustomizer> retryTemplateCustomizers;
private RabbitProperties rabbitProperties;
private final RabbitProperties rabbitProperties;
/**
* Creates a new configurer that will use the given {@code rabbitProperties}.

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnJndiCondition.java

@ -81,7 +81,7 @@ class OnJndiCondition extends SpringBootCondition { @@ -81,7 +81,7 @@ class OnJndiCondition extends SpringBootCondition {
protected static class JndiLocator extends JndiLocatorSupport {
private String[] locations;
private final String[] locations;
public JndiLocator(String[] locations) {
this.locations = locations;

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceAutoConfiguration.java

@ -87,7 +87,7 @@ public class MessageSourceAutoConfiguration { @@ -87,7 +87,7 @@ public class MessageSourceAutoConfiguration {
protected static class ResourceBundleCondition extends SpringBootCondition {
private static ConcurrentReferenceHashMap<String, ConditionOutcome> cache = new ConcurrentReferenceHashMap<>();
private static final ConcurrentReferenceHashMap<String, ConditionOutcome> cache = new ConcurrentReferenceHashMap<>();
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/servlet/GraphQlWebMvcAutoConfiguration.java

@ -89,7 +89,7 @@ public class GraphQlWebMvcAutoConfiguration { @@ -89,7 +89,7 @@ public class GraphQlWebMvcAutoConfiguration {
private static final Log logger = LogFactory.getLog(GraphQlWebMvcAutoConfiguration.class);
@SuppressWarnings("removal")
private static MediaType[] SUPPORTED_MEDIA_TYPES = new MediaType[] { MediaType.APPLICATION_GRAPHQL_RESPONSE,
private static final MediaType[] SUPPORTED_MEDIA_TYPES = new MediaType[] { MediaType.APPLICATION_GRAPHQL_RESPONSE,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_GRAPHQL };
@Bean

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapProperties.java

@ -58,7 +58,7 @@ public class EmbeddedLdapProperties { @@ -58,7 +58,7 @@ public class EmbeddedLdapProperties {
/**
* Schema validation.
*/
private Validation validation = new Validation();
private final Validation validation = new Validation();
public int getPort() {
return this.port;

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportMessage.java

@ -41,7 +41,7 @@ import org.springframework.util.StringUtils; @@ -41,7 +41,7 @@ import org.springframework.util.StringUtils;
*/
public class ConditionEvaluationReportMessage {
private StringBuilder message;
private final StringBuilder message;
public ConditionEvaluationReportMessage(ConditionEvaluationReport report) {
this(report, "CONDITIONS EVALUATION REPORT");

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailProperties.java

@ -69,7 +69,7 @@ public class MailProperties { @@ -69,7 +69,7 @@ public class MailProperties {
/**
* Additional JavaMail Session properties.
*/
private Map<String, String> properties = new HashMap<>();
private final Map<String, String> properties = new HashMap<>();
/**
* Session JNDI name. When set, takes precedence over other Session settings.

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java

@ -80,7 +80,7 @@ class HibernateJpaConfiguration extends JpaBaseConfiguration { @@ -80,7 +80,7 @@ class HibernateJpaConfiguration extends JpaBaseConfiguration {
private final HibernateDefaultDdlAutoProvider defaultDdlAutoProvider;
private DataSourcePoolMetadataProvider poolMetadataProvider;
private final DataSourcePoolMetadataProvider poolMetadataProvider;
private final List<HibernatePropertiesCustomizer> hibernatePropertiesCustomizers;

4
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

@ -1787,12 +1787,12 @@ public class ServerProperties { @@ -1787,12 +1787,12 @@ public class ServerProperties {
/**
* Socket options as defined in org.xnio.Options.
*/
private Map<String, String> socket = new LinkedHashMap<>();
private final Map<String, String> socket = new LinkedHashMap<>();
/**
* Server options as defined in io.undertow.UndertowOptions.
*/
private Map<String, String> server = new LinkedHashMap<>();
private final Map<String, String> server = new LinkedHashMap<>();
public Map<String, String> getServer() {
return this.server;

4
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java

@ -66,7 +66,7 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered { @@ -66,7 +66,7 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered {
SERIES_VIEWS = Collections.unmodifiableMap(views);
}
private ApplicationContext applicationContext;
private final ApplicationContext applicationContext;
private final Resources resources;
@ -145,7 +145,7 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered { @@ -145,7 +145,7 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered {
*/
private static class HtmlResourceView implements View {
private Resource resource;
private final Resource resource;
HtmlResourceView(Resource resource) {
this.resource = resource;

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AbstractDependsOnBeanFactoryPostProcessorTests.java

@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class AbstractDependsOnBeanFactoryPostProcessorTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withUserConfiguration(FooBarConfiguration.class);
@Test

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java

@ -56,7 +56,7 @@ class AutoConfigurationImportSelectorTests { @@ -56,7 +56,7 @@ class AutoConfigurationImportSelectorTests {
private final MockEnvironment environment = new MockEnvironment();
private List<AutoConfigurationImportFilter> filters = new ArrayList<>();
private final List<AutoConfigurationImportFilter> filters = new ArrayList<>();
@BeforeEach
void setup() {

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBeanTests.java

@ -488,7 +488,7 @@ class ConditionalOnBeanTests { @@ -488,7 +488,7 @@ class ConditionalOnBeanTests {
@TestAnnotation
static class ExampleBean {
private String value;
private final String value;
ExampleBean(String value) {
this.value = value;

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnJndiTests.java

@ -51,7 +51,7 @@ class ConditionalOnJndiTests { @@ -51,7 +51,7 @@ class ConditionalOnJndiTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner();
private MockableOnJndi condition = new MockableOnJndi();
private final MockableOnJndi condition = new MockableOnJndi();
@BeforeEach
void setupThreadContextClassLoader() {
@ -149,7 +149,7 @@ class ConditionalOnJndiTests { @@ -149,7 +149,7 @@ class ConditionalOnJndiTests {
static class MockableOnJndi extends OnJndiCondition {
private boolean jndiAvailable = true;
private final boolean jndiAvailable = true;
private String foundLocation;

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBeanTests.java

@ -741,7 +741,7 @@ class ConditionalOnMissingBeanTests { @@ -741,7 +741,7 @@ class ConditionalOnMissingBeanTests {
@TestAnnotation
static class ExampleBean {
private String value;
private final String value;
ExampleBean(String value) {
this.value = value;

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnPropertyTests.java

@ -50,7 +50,7 @@ class ConditionalOnPropertyTests { @@ -50,7 +50,7 @@ class ConditionalOnPropertyTests {
private ConfigurableApplicationContext context;
private ConfigurableEnvironment environment = new StandardEnvironment();
private final ConfigurableEnvironment environment = new StandardEnvironment();
@AfterEach
void tearDown() {

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java

@ -35,9 +35,9 @@ import static org.mockito.Mockito.mock; @@ -35,9 +35,9 @@ import static org.mockito.Mockito.mock;
*/
class OnClassConditionAutoConfigurationImportFilterTests {
private OnClassCondition filter = new OnClassCondition();
private final OnClassCondition filter = new OnClassCondition();
private DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
private final DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
@BeforeEach
void setup() {

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/city/City.java

@ -32,11 +32,11 @@ public class City implements Serializable { @@ -32,11 +32,11 @@ public class City implements Serializable {
@GeneratedValue
private Long id;
private String name;
private final String name;
private String state;
private Country country;
private final Country country;
private String map;

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/country/Country.java

@ -31,7 +31,7 @@ public class Country implements Serializable { @@ -31,7 +31,7 @@ public class Country implements Serializable {
@GeneratedValue
private Long id;
private String name;
private final String name;
public Country(String name) {
this.name = name;

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java

@ -50,7 +50,7 @@ class RedisRepositoriesAutoConfigurationTests { @@ -50,7 +50,7 @@ class RedisRepositoriesAutoConfigurationTests {
public static RedisContainer redis = new RedisContainer().withStartupAttempts(5)
.withStartupTimeout(Duration.ofMinutes(10));
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
@BeforeEach
void setUp() {

3
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/GraphQlTestDataFetchers.java

@ -31,7 +31,8 @@ import org.springframework.lang.Nullable; @@ -31,7 +31,8 @@ import org.springframework.lang.Nullable;
*/
public final class GraphQlTestDataFetchers {
private static List<Book> books = Arrays.asList(new Book("book-1", "GraphQL for beginners", 100, "John GraphQL"),
private static final List<Book> books = Arrays.asList(
new Book("book-1", "GraphQL for beginners", 100, "John GraphQL"),
new Book("book-2", "Harry Potter and the Philosopher's Stone", 223, "Joanne Rowling"),
new Book("book-3", "Moby Dick", 635, "Moby Dick"), new Book("book-3", "Moby Dick", 635, "Moby Dick"));

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAutoConfigurationTests.java

@ -55,7 +55,7 @@ class GroovyTemplateAutoConfigurationTests { @@ -55,7 +55,7 @@ class GroovyTemplateAutoConfigurationTests {
private final BuildOutput buildOutput = new BuildOutput(getClass());
private AnnotationConfigServletWebApplicationContext context = new AnnotationConfigServletWebApplicationContext();
private final AnnotationConfigServletWebApplicationContext context = new AnnotationConfigServletWebApplicationContext();
@BeforeEach
void setupContext() {

6
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAvailabilityProviderTests.java

@ -32,11 +32,11 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -32,11 +32,11 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class GroovyTemplateAvailabilityProviderTests {
private TemplateAvailabilityProvider provider = new GroovyTemplateAvailabilityProvider();
private final TemplateAvailabilityProvider provider = new GroovyTemplateAvailabilityProvider();
private ResourceLoader resourceLoader = new DefaultResourceLoader();
private final ResourceLoader resourceLoader = new DefaultResourceLoader();
private MockEnvironment environment = new MockEnvironment();
private final MockEnvironment environment = new MockEnvironment();
@Test
void availabilityOfTemplateInDefaultLocation() {

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/gson/GsonAutoConfigurationTests.java

@ -241,7 +241,7 @@ class GsonAutoConfigurationTests { @@ -241,7 +241,7 @@ class GsonAutoConfigurationTests {
private Long data = 1L;
@SuppressWarnings("unused")
private String owner = null;
private final String owner = null;
public void setData(Long data) {
this.data = data;
@ -254,7 +254,7 @@ class GsonAutoConfigurationTests { @@ -254,7 +254,7 @@ class GsonAutoConfigurationTests {
@SuppressWarnings("unused")
class NestedObject {
private String data = "nested";
private final String data = "nested";
}

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java

@ -636,7 +636,7 @@ class JacksonAutoConfigurationTests { @@ -636,7 +636,7 @@ class JacksonAutoConfigurationTests {
static class CustomModule extends SimpleModule {
private Set<ObjectCodec> owners = new HashSet<>();
private final Set<ObjectCodec> owners = new HashSet<>();
@Override
public void setupModule(SetupContext context) {

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceJsonSerializationTests.java

@ -80,7 +80,7 @@ class DataSourceJsonSerializationTests { @@ -80,7 +80,7 @@ class DataSourceJsonSerializationTests {
static class TomcatDataSourceSerializer extends JsonSerializer<DataSource> {
private ConversionService conversionService = new DefaultConversionService();
private final ConversionService conversionService = new DefaultConversionService();
@Override
public void serialize(DataSource value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
@ -99,7 +99,7 @@ class DataSourceJsonSerializationTests { @@ -99,7 +99,7 @@ class DataSourceJsonSerializationTests {
static class GenericSerializerModifier extends BeanSerializerModifier {
private ConversionService conversionService = new DefaultConversionService();
private final ConversionService conversionService = new DefaultConversionService();
@Override
public List<BeanPropertyWriter> changeProperties(SerializationConfig config, BeanDescription beanDesc,

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/ParentAwareNamingStrategyTests.java

@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class ParentAwareNamingStrategyTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner();
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner();
@Test
void objectNameMatchesManagedResourceByDefault() {

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java

@ -462,7 +462,7 @@ class LiquibaseAutoConfigurationTests { @@ -462,7 +462,7 @@ class LiquibaseAutoConfigurationTests {
@Configuration(proxyBeanMethods = false)
static class CustomDataSourceConfiguration {
private String name = UUID.randomUUID().toString();
private final String name = UUID.randomUUID().toString();
@Bean(destroyMethod = "shutdown")
EmbeddedDatabase dataSource() throws SQLException {
@ -484,7 +484,7 @@ class LiquibaseAutoConfigurationTests { @@ -484,7 +484,7 @@ class LiquibaseAutoConfigurationTests {
@Configuration(proxyBeanMethods = false)
static class CustomDriverConfiguration {
private String name = UUID.randomUUID().toString();
private final String name = UUID.randomUUID().toString();
@Bean
SimpleDriverDataSource dataSource() {

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java

@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
@ExtendWith(OutputCaptureExtension.class)
class ConditionEvaluationReportLoggingListenerTests {
private ConditionEvaluationReportLoggingListener initializer = new ConditionEvaluationReportLoggingListener();
private final ConditionEvaluationReportLoggingListener initializer = new ConditionEvaluationReportLoggingListener();
@Test
void logsDebugOnContextRefresh(CapturedOutput output) {

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityPropertiesTests.java

@ -33,11 +33,11 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -33,11 +33,11 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class SecurityPropertiesTests {
private SecurityProperties security = new SecurityProperties();
private final SecurityProperties security = new SecurityProperties();
private Binder binder;
private MapConfigurationPropertySource source = new MapConfigurationPropertySource();
private final MapConfigurationPropertySource source = new MapConfigurationPropertySource();
@BeforeEach
void setUp() {

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesTests.java

@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; @@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
*/
class OAuth2ClientPropertiesTests {
private OAuth2ClientProperties properties = new OAuth2ClientProperties();
private final OAuth2ClientProperties properties = new OAuth2ClientProperties();
@Test
void clientIdAbsentThrowsException() {

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java

@ -79,7 +79,7 @@ import static org.mockito.Mockito.mock; @@ -79,7 +79,7 @@ import static org.mockito.Mockito.mock;
*/
class OAuth2ResourceServerAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(OAuth2ResourceServerAutoConfiguration.class))
.withUserConfiguration(TestConfig.class);

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java

@ -45,7 +45,7 @@ import static org.mockito.Mockito.mock; @@ -45,7 +45,7 @@ import static org.mockito.Mockito.mock;
*/
class StaticResourceRequestTests {
private StaticResourceRequest resourceRequest = StaticResourceRequest.INSTANCE;
private final StaticResourceRequest resourceRequest = StaticResourceRequest.INSTANCE;
@Test
void atCommonLocationsShouldMatchCommonLocations() {

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java

@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException @@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
*/
class StaticResourceRequestTests {
private StaticResourceRequest resourceRequest = StaticResourceRequest.INSTANCE;
private final StaticResourceRequest resourceRequest = StaticResourceRequest.INSTANCE;
@Test
void atCommonLocationsShouldMatchCommonLocations() {

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/sql/init/SqlInitializationAutoConfigurationTests.java

@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class SqlInitializationAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(SqlInitializationAutoConfiguration.class)).withPropertyValues(
"spring.datasource.generate-unique-name:true", "spring.r2dbc.generate-unique-name:true");

6
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java

@ -49,11 +49,11 @@ class TemplateAvailabilityProvidersTests { @@ -49,11 +49,11 @@ class TemplateAvailabilityProvidersTests {
@Mock
private TemplateAvailabilityProvider provider;
private String view = "view";
private final String view = "view";
private ClassLoader classLoader = getClass().getClassLoader();
private final ClassLoader classLoader = getClass().getClassLoader();
private MockEnvironment environment = new MockEnvironment();
private final MockEnvironment environment = new MockEnvironment();
@Mock
private ResourceLoader resourceLoader;

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java

@ -422,7 +422,7 @@ class ValidationAutoConfigurationTests { @@ -422,7 +422,7 @@ class ValidationAutoConfigurationTests {
static class TestBeanPostProcessor implements BeanPostProcessor {
private Set<String> postProcessed = new HashSet<>();
private final Set<String> postProcessed = new HashSet<>();
@Override
public Object postProcessAfterInitialization(Object bean, String name) {

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapterTests.java

@ -134,7 +134,7 @@ class ValidatorAdapterTests { @@ -134,7 +134,7 @@ class ValidatorAdapterTests {
static class SampleData {
@Min(42)
private int counter;
private final int counter;
SampleData(int counter) {
this.counter = counter;

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryCustomizerTests.java

@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock;
*/
class ReactiveWebServerFactoryCustomizerTests {
private ServerProperties properties = new ServerProperties();
private final ServerProperties properties = new ServerProperties();
private ReactiveWebServerFactoryCustomizer customizer;

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageIntegrationTests.java

@ -48,7 +48,7 @@ class WelcomePageIntegrationTests { @@ -48,7 +48,7 @@ class WelcomePageIntegrationTests {
@LocalServerPort
private int port;
private TestRestTemplate template = new TestRestTemplate();
private final TestRestTemplate template = new TestRestTemplate();
@Test
void contentStrategyWithWelcomePage() throws Exception {

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolverTests.java

@ -65,9 +65,9 @@ class DefaultErrorViewResolverTests { @@ -65,9 +65,9 @@ class DefaultErrorViewResolverTests {
private Resources resourcesProperties;
private Map<String, Object> model = new HashMap<>();
private final Map<String, Object> model = new HashMap<>();
private HttpServletRequest request = new MockHttpServletRequest();
private final HttpServletRequest request = new MockHttpServletRequest();
@BeforeEach
void setup() {

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/RemappedErrorViewIntegrationTests.java

@ -51,7 +51,7 @@ class RemappedErrorViewIntegrationTests { @@ -51,7 +51,7 @@ class RemappedErrorViewIntegrationTests {
@LocalServerPort
private int port;
private TestRestTemplate template = new TestRestTemplate();
private final TestRestTemplate template = new TestRestTemplate();
@Test
void directAccessToErrorPage() {

6
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java

@ -78,7 +78,7 @@ import static org.junit.jupiter.api.Assertions.fail; @@ -78,7 +78,7 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
class WebSocketMessagingAutoConfigurationTests {
private AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext();
private final AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext();
private SockJsClient sockJsClient;
@ -255,9 +255,9 @@ class WebSocketMessagingAutoConfigurationTests { @@ -255,9 +255,9 @@ class WebSocketMessagingAutoConfigurationTests {
public static class Data {
private int foo;
private final int foo;
private String bar;
private final String bar;
Data(int foo, String bar) {
this.foo = foo;

4
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsProperties.java

@ -35,9 +35,9 @@ import org.springframework.util.StringUtils; @@ -35,9 +35,9 @@ import org.springframework.util.StringUtils;
@ConfigurationProperties(prefix = "spring.devtools")
public class DevToolsProperties {
private Restart restart = new Restart();
private final Restart restart = new Restart();
private Livereload livereload = new Livereload();
private final Livereload livereload = new Livereload();
@NestedConfigurationProperty
private final RemoteDevToolsProperties remote = new RemoteDevToolsProperties();

4
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsProperties.java

@ -46,9 +46,9 @@ public class RemoteDevToolsProperties { @@ -46,9 +46,9 @@ public class RemoteDevToolsProperties {
*/
private String secretHeaderName = DEFAULT_SECRET_HEADER_NAME;
private Restart restart = new Restart();
private final Restart restart = new Restart();
private Proxy proxy = new Proxy();
private final Proxy proxy = new Proxy();
public String getContextPath() {
return this.contextPath;

2
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcher.java

@ -39,7 +39,7 @@ public class ClassPathFileSystemWatcher implements InitializingBean, DisposableB @@ -39,7 +39,7 @@ public class ClassPathFileSystemWatcher implements InitializingBean, DisposableB
private final FileSystemWatcher fileSystemWatcher;
private ClassPathRestartStrategy restartStrategy;
private final ClassPathRestartStrategy restartStrategy;
private ApplicationContext applicationContext;

2
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/DirectorySnapshot.java

@ -43,7 +43,7 @@ class DirectorySnapshot { @@ -43,7 +43,7 @@ class DirectorySnapshot {
private final Date time;
private Set<FileSnapshot> files;
private final Set<FileSnapshot> files;
/**
* Create a new {@link DirectorySnapshot} for the given directory.

2
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java

@ -237,7 +237,7 @@ public class FileSystemWatcher { @@ -237,7 +237,7 @@ public class FileSystemWatcher {
private Map<File, DirectorySnapshot> directories;
private SnapshotStateRepository snapshotStateRepository;
private final SnapshotStateRepository snapshotStateRepository;
private Watcher(AtomicInteger remainingScans, List<FileChangeListener> listeners, FileFilter triggerFilter,
long pollInterval, long quietPeriod, Map<File, DirectorySnapshot> directories,

2
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/RemoteClientConfiguration.java

@ -139,7 +139,7 @@ public class RemoteClientConfiguration implements InitializingBean { @@ -139,7 +139,7 @@ public class RemoteClientConfiguration implements InitializingBean {
private final String remoteUrl;
private ExecutorService executor = Executors.newSingleThreadExecutor();
private final ExecutorService executor = Executors.newSingleThreadExecutor();
LiveReloadConfiguration(DevToolsProperties properties, ClientHttpRequestFactory clientHttpRequestFactory,
@Value("${remoteUrl}") String remoteUrl) {

2
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java

@ -106,7 +106,7 @@ public class Restarter { @@ -106,7 +106,7 @@ public class Restarter {
private boolean enabled = true;
private URL[] initialUrls;
private final URL[] initialUrls;
private final String mainClassName;

2
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/HttpTunnelConnection.java

@ -113,7 +113,7 @@ public class HttpTunnelConnection implements TunnelConnection { @@ -113,7 +113,7 @@ public class HttpTunnelConnection implements TunnelConnection {
private boolean open = true;
private AtomicLong requestSeq = new AtomicLong();
private final AtomicLong requestSeq = new AtomicLong();
public TunnelChannel(WritableByteChannel incomingChannel, Closeable closeable) {
this.forwarder = new HttpTunnelPayloadForwarder(incomingChannel);

4
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServer.java

@ -214,7 +214,7 @@ public class HttpTunnelServer { @@ -214,7 +214,7 @@ public class HttpTunnelServer {
private boolean closed;
private AtomicLong responseSeq = new AtomicLong();
private final AtomicLong responseSeq = new AtomicLong();
private long lastHttpRequestTime;
@ -364,7 +364,7 @@ public class HttpTunnelServer { @@ -364,7 +364,7 @@ public class HttpTunnelServer {
private final ServerHttpResponse response;
private ServerHttpAsyncRequestControl async;
private final ServerHttpAsyncRequestControl async;
private volatile boolean complete = false;

2
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerHandler.java

@ -31,7 +31,7 @@ import org.springframework.util.Assert; @@ -31,7 +31,7 @@ import org.springframework.util.Assert;
*/
public class HttpTunnelServerHandler implements Handler {
private HttpTunnelServer server;
private final HttpTunnelServer server;
/**
* Create a new {@link HttpTunnelServerHandler} instance.

2
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathChangedEventTests.java

@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException @@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
*/
class ClassPathChangedEventTests {
private Object source = new Object();
private final Object source = new Object();
@Test
void changeSetMustNotBeNull() {

2
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java

@ -117,7 +117,7 @@ class ClassPathFileSystemWatcherTests { @@ -117,7 +117,7 @@ class ClassPathFileSystemWatcherTests {
static class Listener implements ApplicationListener<ClassPathChangedEvent> {
private List<ClassPathChangedEvent> events = new CopyOnWriteArrayList<>();
private final List<ClassPathChangedEvent> events = new CopyOnWriteArrayList<>();
@Override
public void onApplicationEvent(ClassPathChangedEvent event) {

2
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java

@ -50,7 +50,7 @@ class FileSystemWatcherTests { @@ -50,7 +50,7 @@ class FileSystemWatcherTests {
private FileSystemWatcher watcher;
private List<Set<ChangedFiles>> changes = Collections.synchronizedList(new ArrayList<>());
private final List<Set<ChangedFiles>> changes = Collections.synchronizedList(new ArrayList<>());
@TempDir
File tempDir;

6
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java

@ -54,11 +54,11 @@ class DispatcherTests { @@ -54,11 +54,11 @@ class DispatcherTests {
@Mock
private AccessManager accessManager;
private MockHttpServletResponse response = new MockHttpServletResponse();
private final MockHttpServletResponse response = new MockHttpServletResponse();
private ServerHttpRequest serverRequest = new ServletServerHttpRequest(new MockHttpServletRequest());
private final ServerHttpRequest serverRequest = new ServletServerHttpRequest(new MockHttpServletRequest());
private ServerHttpResponse serverResponse = new ServletServerHttpResponse(this.response);
private final ServerHttpResponse serverResponse = new ServletServerHttpResponse(this.response);
@Test
void accessManagerMustNotBeNull() {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save