Commit dac63fc3 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish

parent 8b3f8a61
...@@ -341,7 +341,7 @@ public class BomExtension { ...@@ -341,7 +341,7 @@ public class BomExtension {
private String repository = "spring-boot"; private String repository = "spring-boot";
private List<String> issueLabels; private final List<String> issueLabels;
private GitHub(String organization, String repository, List<String> issueLabels) { private GitHub(String organization, String repository, List<String> issueLabels) {
this.organization = organization; this.organization = organization;
......
...@@ -47,7 +47,7 @@ public enum UpgradePolicy implements BiPredicate<DependencyVersion, DependencyVe ...@@ -47,7 +47,7 @@ public enum UpgradePolicy implements BiPredicate<DependencyVersion, DependencyVe
*/ */
SAME_MINOR_VERSION(DependencyVersion::isSameMinorAndNewerThan); SAME_MINOR_VERSION(DependencyVersion::isSameMinorAndNewerThan);
private BiPredicate<DependencyVersion, DependencyVersion> delegate; private final BiPredicate<DependencyVersion, DependencyVersion> delegate;
UpgradePolicy(BiPredicate<DependencyVersion, DependencyVersion> delegate) { UpgradePolicy(BiPredicate<DependencyVersion, DependencyVersion> delegate) {
this.delegate = delegate; this.delegate = delegate;
......
...@@ -27,9 +27,9 @@ import java.util.stream.Stream; ...@@ -27,9 +27,9 @@ import java.util.stream.Stream;
*/ */
class CompoundConfigurationTableEntry extends ConfigurationTableEntry { class CompoundConfigurationTableEntry extends ConfigurationTableEntry {
private Set<String> configurationKeys; private final Set<String> configurationKeys;
private String description; private final String description;
CompoundConfigurationTableEntry(String key, String description) { CompoundConfigurationTableEntry(String key, String description) {
this.key = key; this.key = key;
......
...@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory; ...@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
*/ */
public class MavenExec extends JavaExec { public class MavenExec extends JavaExec {
private Logger log = LoggerFactory.getLogger(MavenExec.class); private final Logger log = LoggerFactory.getLogger(MavenExec.class);
private File projectDir; private File projectDir;
......
...@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
public class CompoundConfigurationTableEntryTests { public class CompoundConfigurationTableEntryTests {
private static String NEWLINE = System.lineSeparator(); private static final String NEWLINE = System.lineSeparator();
@Test @Test
void simpleProperty() { void simpleProperty() {
......
...@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
public class ConfigurationTableTests { public class ConfigurationTableTests {
private static String NEWLINE = System.lineSeparator(); private static final String NEWLINE = System.lineSeparator();
@Test @Test
void simpleTable() { void simpleTable() {
......
...@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
public class SingleConfigurationTableEntryTests { public class SingleConfigurationTableEntryTests {
private static String NEWLINE = System.lineSeparator(); private static final String NEWLINE = System.lineSeparator();
@Test @Test
void simpleProperty() { void simpleProperty() {
......
...@@ -51,7 +51,7 @@ import org.springframework.util.ObjectUtils; ...@@ -51,7 +51,7 @@ import org.springframework.util.ObjectUtils;
*/ */
class AutoConfiguredHealthEndpointGroups implements HealthEndpointGroups { class AutoConfiguredHealthEndpointGroups implements HealthEndpointGroups {
private static Predicate<String> ALL = (name) -> true; private static final Predicate<String> ALL = (name) -> true;
private final HealthEndpointGroup primaryGroup; private final HealthEndpointGroup primaryGroup;
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class RabbitHealthContributorAutoConfigurationTests { class RabbitHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RabbitAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(RabbitAutoConfiguration.class,
RabbitHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); RabbitHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class AuditAutoConfigurationTests { class AuditAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(AuditAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(AuditAutoConfiguration.class));
@Test @Test
......
...@@ -34,8 +34,9 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -34,8 +34,9 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class AvailabilityHealthContributorAutoConfigurationTests { class AvailabilityHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.of(ApplicationAvailabilityAutoConfiguration.class, AvailabilityHealthContributorAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ApplicationAvailabilityAutoConfiguration.class,
AvailabilityHealthContributorAutoConfiguration.class));
@Test @Test
void probesWhenNotKubernetesAddsNoBeans() { void probesWhenNotKubernetesAddsNoBeans() {
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -49,7 +49,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -49,7 +49,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class CloudFoundryReactiveHealthEndpointWebExtensionTests { class CloudFoundryReactiveHealthEndpointWebExtensionTests {
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
.withPropertyValues("VCAP_APPLICATION={}") .withPropertyValues("VCAP_APPLICATION={}")
.withConfiguration(AutoConfigurations.of(ReactiveSecurityAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ReactiveSecurityAutoConfiguration.class,
ReactiveUserDetailsServiceAutoConfiguration.class, WebFluxAutoConfiguration.class, ReactiveUserDetailsServiceAutoConfiguration.class, WebFluxAutoConfiguration.class,
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class CloudFoundryHealthEndpointWebExtensionTests { class CloudFoundryHealthEndpointWebExtensionTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withPropertyValues("VCAP_APPLICATION={}") .withPropertyValues("VCAP_APPLICATION={}")
.withConfiguration(AutoConfigurations.of(SecurityAutoConfiguration.class, WebMvcAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(SecurityAutoConfiguration.class, WebMvcAutoConfiguration.class,
JacksonAutoConfiguration.class, DispatcherServletAutoConfiguration.class, JacksonAutoConfiguration.class, DispatcherServletAutoConfiguration.class,
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class CloudFoundryInfoEndpointWebExtensionTests { class CloudFoundryInfoEndpointWebExtensionTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withPropertyValues("VCAP_APPLICATION={}") .withPropertyValues("VCAP_APPLICATION={}")
.withConfiguration(AutoConfigurations.of(SecurityAutoConfiguration.class, WebMvcAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(SecurityAutoConfiguration.class, WebMvcAutoConfiguration.class,
JacksonAutoConfiguration.class, DispatcherServletAutoConfiguration.class, JacksonAutoConfiguration.class, DispatcherServletAutoConfiguration.class,
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -35,7 +35,7 @@ import static org.mockito.Mockito.mock; ...@@ -35,7 +35,7 @@ import static org.mockito.Mockito.mock;
*/ */
class CouchbaseHealthContributorAutoConfigurationTests { class CouchbaseHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(Cluster.class, () -> mock(Cluster.class)).withConfiguration(AutoConfigurations .withBean(Cluster.class, () -> mock(Cluster.class)).withConfiguration(AutoConfigurations
.of(CouchbaseHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); .of(CouchbaseHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -35,7 +35,7 @@ import static org.mockito.Mockito.mock; ...@@ -35,7 +35,7 @@ import static org.mockito.Mockito.mock;
*/ */
class CouchbaseReactiveHealthContributorAutoConfigurationTests { class CouchbaseReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(Cluster.class, () -> mock(Cluster.class)) .withBean(Cluster.class, () -> mock(Cluster.class))
.withConfiguration(AutoConfigurations.of(CouchbaseReactiveHealthContributorAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(CouchbaseReactiveHealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class)); HealthContributorAutoConfiguration.class));
......
...@@ -36,8 +36,9 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -36,8 +36,9 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class ElasticsearchReactiveHealthContributorAutoConfigurationTests { class ElasticsearchReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.of(ElasticsearchDataAutoConfiguration.class, ReactiveElasticsearchRestClientAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ElasticsearchDataAutoConfiguration.class,
ReactiveElasticsearchRestClientAutoConfiguration.class,
ElasticsearchRestClientAutoConfiguration.class, ElasticsearchRestClientAutoConfiguration.class,
ElasticSearchReactiveHealthContributorAutoConfiguration.class, ElasticSearchReactiveHealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class)); HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class ServletEndpointManagementContextConfigurationTests { class ServletEndpointManagementContextConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withUserConfiguration(TestConfig.class); .withUserConfiguration(TestConfig.class);
@Test @Test
......
...@@ -54,7 +54,7 @@ class WebEndpointAutoConfigurationTests { ...@@ -54,7 +54,7 @@ class WebEndpointAutoConfigurationTests {
private static final AutoConfigurations CONFIGURATIONS = AutoConfigurations.of(EndpointAutoConfiguration.class, private static final AutoConfigurations CONFIGURATIONS = AutoConfigurations.of(EndpointAutoConfiguration.class,
WebEndpointAutoConfiguration.class); WebEndpointAutoConfiguration.class);
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(CONFIGURATIONS); .withConfiguration(CONFIGURATIONS);
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class HazelcastHealthContributorAutoConfigurationIntegrationTests { class HazelcastHealthContributorAutoConfigurationIntegrationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HazelcastHealthContributorAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(HazelcastHealthContributorAutoConfiguration.class,
HazelcastAutoConfiguration.class, HealthContributorAutoConfiguration.class)); HazelcastAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class HazelcastHealthContributorAutoConfigurationTests { class HazelcastHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HazelcastAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(HazelcastAutoConfiguration.class,
HazelcastHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); HazelcastHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class HealthContributorAutoConfigurationTests { class HealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HealthContributorAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(HealthContributorAutoConfiguration.class));
@Test @Test
......
...@@ -68,11 +68,11 @@ import static org.mockito.Mockito.mock; ...@@ -68,11 +68,11 @@ import static org.mockito.Mockito.mock;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
class HealthEndpointAutoConfigurationTests { class HealthEndpointAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withUserConfiguration(HealthIndicatorsConfiguration.class).withConfiguration(AutoConfigurations .withUserConfiguration(HealthIndicatorsConfiguration.class).withConfiguration(AutoConfigurations
.of(HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class)); .of(HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
private ReactiveWebApplicationContextRunner reactiveContextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner reactiveContextRunner = new ReactiveWebApplicationContextRunner()
.withUserConfiguration(HealthIndicatorsConfiguration.class).withConfiguration(AutoConfigurations .withUserConfiguration(HealthIndicatorsConfiguration.class).withConfiguration(AutoConfigurations
.of(HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class)); .of(HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock; ...@@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock;
*/ */
class InfluxDbHealthContributorAutoConfigurationTests { class InfluxDbHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(InfluxDB.class, () -> mock(InfluxDB.class)).withConfiguration(AutoConfigurations .withBean(InfluxDB.class, () -> mock(InfluxDB.class)).withConfiguration(AutoConfigurations
.of(InfluxDbHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); .of(InfluxDbHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -46,7 +46,7 @@ import org.springframework.test.web.reactive.server.WebTestClient; ...@@ -46,7 +46,7 @@ import org.springframework.test.web.reactive.server.WebTestClient;
*/ */
class WebFluxEndpointCorsIntegrationTests { class WebFluxEndpointCorsIntegrationTests {
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(JacksonAutoConfiguration.class, CodecsAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(JacksonAutoConfiguration.class, CodecsAutoConfiguration.class,
WebFluxAutoConfiguration.class, HttpHandlerAutoConfiguration.class, EndpointAutoConfiguration.class, WebFluxAutoConfiguration.class, HttpHandlerAutoConfiguration.class, EndpointAutoConfiguration.class,
WebEndpointAutoConfiguration.class, ManagementContextAutoConfiguration.class, WebEndpointAutoConfiguration.class, ManagementContextAutoConfiguration.class,
......
...@@ -48,7 +48,7 @@ import static org.mockito.Mockito.mock; ...@@ -48,7 +48,7 @@ import static org.mockito.Mockito.mock;
*/ */
class DataSourceHealthContributorAutoConfigurationTests { class DataSourceHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class,
HealthContributorAutoConfiguration.class, DataSourceHealthContributorAutoConfiguration.class)) HealthContributorAutoConfiguration.class, DataSourceHealthContributorAutoConfiguration.class))
.withPropertyValues("spring.datasource.initialization-mode=never"); .withPropertyValues("spring.datasource.initialization-mode=never");
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -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 JmsHealthContributorAutoConfigurationTests { class JmsHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ActiveMQAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ActiveMQAutoConfiguration.class,
JmsHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); JmsHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -35,7 +35,7 @@ import static org.mockito.Mockito.mock; ...@@ -35,7 +35,7 @@ import static org.mockito.Mockito.mock;
*/ */
class LdapHealthContributorAutoConfigurationTests { class LdapHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(LdapOperations.class, () -> mock(LdapOperations.class)).withConfiguration(AutoConfigurations .withBean(LdapOperations.class, () -> mock(LdapOperations.class)).withConfiguration(AutoConfigurations
.of(LdapHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); .of(LdapHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
...@@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.contentOf; ...@@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.contentOf;
*/ */
class LogFileWebEndpointAutoConfigurationTests { class LogFileWebEndpointAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(LogFileWebEndpointAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(LogFileWebEndpointAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class MailHealthContributorAutoConfigurationTests { class MailHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MailSenderAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(MailSenderAutoConfiguration.class,
MailHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)) MailHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class))
.withPropertyValues("spring.mail.host:smtp.example.com"); .withPropertyValues("spring.mail.host:smtp.example.com");
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -41,7 +41,7 @@ class CompositeMeterRegistryAutoConfigurationTests { ...@@ -41,7 +41,7 @@ class CompositeMeterRegistryAutoConfigurationTests {
private static final String COMPOSITE_NAME = "compositeMeterRegistry"; private static final String COMPOSITE_NAME = "compositeMeterRegistry";
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withUserConfiguration(BaseConfig.class) .withUserConfiguration(BaseConfig.class)
.withConfiguration(AutoConfigurations.of(CompositeMeterRegistryAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(CompositeMeterRegistryAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class MeterRegistryConfigurerIntegrationTests { class MeterRegistryConfigurerIntegrationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.with(MetricsRun.limitedTo(AtlasMetricsExportAutoConfiguration.class, .with(MetricsRun.limitedTo(AtlasMetricsExportAutoConfiguration.class,
PrometheusMetricsExportAutoConfiguration.class)) PrometheusMetricsExportAutoConfiguration.class))
.withConfiguration(AutoConfigurations.of(JvmMetricsAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(JvmMetricsAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class MeterRegistryCustomizerTests { class MeterRegistryCustomizerTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.with(MetricsRun.limitedTo(AtlasMetricsExportAutoConfiguration.class, .with(MetricsRun.limitedTo(AtlasMetricsExportAutoConfiguration.class,
PrometheusMetricsExportAutoConfiguration.class)) PrometheusMetricsExportAutoConfiguration.class))
.withConfiguration(AutoConfigurations.of(JvmMetricsAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(JvmMetricsAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -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 MetricsAutoConfigurationIntegrationTests { class MetricsAutoConfigurationIntegrationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple()); private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple());
@Test @Test
void propertyBasedMeterFilteringIsAutoConfigured() { void propertyBasedMeterFilteringIsAutoConfigured() {
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class RabbitMetricsAutoConfigurationTests { class RabbitMetricsAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple()) private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple())
.withConfiguration( .withConfiguration(
AutoConfigurations.of(RabbitAutoConfiguration.class, RabbitMetricsAutoConfiguration.class)); AutoConfigurations.of(RabbitAutoConfiguration.class, RabbitMetricsAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class CacheMetricsAutoConfigurationTests { class CacheMetricsAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple()) private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple())
.withUserConfiguration(CachingConfiguration.class).withConfiguration( .withUserConfiguration(CachingConfiguration.class).withConfiguration(
AutoConfigurations.of(CacheAutoConfiguration.class, CacheMetricsAutoConfiguration.class)); AutoConfigurations.of(CacheAutoConfiguration.class, CacheMetricsAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class DataSourcePoolMetricsAutoConfigurationTests { class DataSourcePoolMetricsAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withPropertyValues("spring.datasource.generate-unique-name=true").with(MetricsRun.simple()) .withPropertyValues("spring.datasource.generate-unique-name=true").with(MetricsRun.simple())
.withConfiguration(AutoConfigurations.of(DataSourcePoolMetricsAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(DataSourcePoolMetricsAutoConfiguration.class))
.withUserConfiguration(BaseConfiguration.class); .withUserConfiguration(BaseConfiguration.class);
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -58,7 +58,7 @@ import static org.mockito.Mockito.mock; ...@@ -58,7 +58,7 @@ import static org.mockito.Mockito.mock;
*/ */
class HibernateMetricsAutoConfigurationTests { class HibernateMetricsAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple()) private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple())
.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class, HibernateMetricsAutoConfiguration.class)) HibernateJpaAutoConfiguration.class, HibernateMetricsAutoConfiguration.class))
.withUserConfiguration(BaseConfiguration.class); .withUserConfiguration(BaseConfiguration.class);
......
...@@ -49,7 +49,7 @@ import static org.mockito.Mockito.mock; ...@@ -49,7 +49,7 @@ import static org.mockito.Mockito.mock;
@ExtendWith(OutputCaptureExtension.class) @ExtendWith(OutputCaptureExtension.class)
class WebFluxMetricsAutoConfigurationTests { class WebFluxMetricsAutoConfigurationTests {
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
.with(MetricsRun.simple()).withConfiguration(AutoConfigurations.of(WebFluxMetricsAutoConfiguration.class)); .with(MetricsRun.simple()).withConfiguration(AutoConfigurations.of(WebFluxMetricsAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -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 MongoHealthContributorAutoConfigurationTests { class MongoHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
MongoHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); MongoHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class MongoReactiveHealthContributorAutoConfigurationTests { class MongoReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
MongoReactiveAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class, MongoReactiveAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class,
MongoReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); MongoReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ClassPathExclusions({ "reactor-core*.jar", "lettuce-core*.jar" }) @ClassPathExclusions({ "reactor-core*.jar", "lettuce-core*.jar" })
class RedisHealthContributorAutoConfigurationTests { class RedisHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class,
RedisHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); RedisHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -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 RedisReactiveHealthContributorAutoConfigurationTests { class RedisReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class,
RedisReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); RedisReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -65,7 +65,7 @@ import static org.mockito.Mockito.mock; ...@@ -65,7 +65,7 @@ import static org.mockito.Mockito.mock;
*/ */
class ReactiveManagementWebSecurityAutoConfigurationTests { class ReactiveManagementWebSecurityAutoConfigurationTests {
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HealthContributorAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class, InfoEndpointAutoConfiguration.class, HealthEndpointAutoConfiguration.class, InfoEndpointAutoConfiguration.class,
EnvironmentEndpointAutoConfiguration.class, EndpointAutoConfiguration.class, EnvironmentEndpointAutoConfiguration.class, EndpointAutoConfiguration.class,
......
...@@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class ManagementWebSecurityAutoConfigurationTests { class ManagementWebSecurityAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner().withConfiguration( private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner().withConfiguration(
AutoConfigurations.of(HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class, AutoConfigurations.of(HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class,
InfoEndpointAutoConfiguration.class, EnvironmentEndpointAutoConfiguration.class, InfoEndpointAutoConfiguration.class, EnvironmentEndpointAutoConfiguration.class,
EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class,
......
...@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class SecurityRequestMatchersManagementContextConfigurationTests { class SecurityRequestMatchersManagementContextConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(SecurityRequestMatchersManagementContextConfiguration.class)); .withConfiguration(AutoConfigurations.of(SecurityRequestMatchersManagementContextConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class SolrHealthContributorAutoConfigurationTests { class SolrHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(SolrAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(SolrAutoConfiguration.class,
SolrHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); SolrHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
......
...@@ -34,8 +34,9 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -34,8 +34,9 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class DiskSpaceHealthContributorAutoConfigurationTests { class DiskSpaceHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.of(DiskSpaceHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(DiskSpaceHealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {
......
...@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class WebMvcEndpointChildContextConfigurationTests { class WebMvcEndpointChildContextConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withAllowBeanDefinitionOverriding(true); .withAllowBeanDefinitionOverriding(true);
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class HttpTraceAutoConfigurationTests { class HttpTraceAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HttpTraceAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(HttpTraceAutoConfiguration.class));
@Test @Test
......
...@@ -41,7 +41,7 @@ public class AvailabilityStateHealthIndicator extends AbstractHealthIndicator { ...@@ -41,7 +41,7 @@ public class AvailabilityStateHealthIndicator extends AbstractHealthIndicator {
private final ApplicationAvailability applicationAvailability; private final ApplicationAvailability applicationAvailability;
private Class<? extends AvailabilityState> stateType; private final Class<? extends AvailabilityState> stateType;
private final Map<AvailabilityState, Status> statusMappings = new HashMap<>(); private final Map<AvailabilityState, Status> statusMappings = new HashMap<>();
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -51,7 +51,7 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r ...@@ -51,7 +51,7 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r
*/ */
class HttpTraceWebFilterIntegrationTests { class HttpTraceWebFilterIntegrationTests {
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
.withUserConfiguration(Config.class); .withUserConfiguration(Config.class);
@Test @Test
......
...@@ -206,7 +206,7 @@ public abstract class AutoConfigurationPackages { ...@@ -206,7 +206,7 @@ public abstract class AutoConfigurationPackages {
static final class BasePackagesBeanDefinition extends GenericBeanDefinition { static final class BasePackagesBeanDefinition extends GenericBeanDefinition {
private Set<String> basePackages = new LinkedHashSet<>(); private final Set<String> basePackages = new LinkedHashSet<>();
BasePackagesBeanDefinition(String... basePackages) { BasePackagesBeanDefinition(String... basePackages) {
setBeanClass(BasePackages.class); setBeanClass(BasePackages.class);
......
...@@ -37,7 +37,7 @@ import org.springframework.util.StringUtils; ...@@ -37,7 +37,7 @@ import org.springframework.util.StringUtils;
*/ */
public final class ConditionMessage { public final class ConditionMessage {
private String message; private final String message;
private ConditionMessage() { private ConditionMessage() {
this(null); this(null);
......
...@@ -150,7 +150,7 @@ public class EntityScanPackages { ...@@ -150,7 +150,7 @@ public class EntityScanPackages {
static class EntityScanPackagesBeanDefinition extends GenericBeanDefinition { static class EntityScanPackagesBeanDefinition extends GenericBeanDefinition {
private Set<String> packageNames = new LinkedHashSet<>(); private final Set<String> packageNames = new LinkedHashSet<>();
EntityScanPackagesBeanDefinition(Collection<String> packageNames) { EntityScanPackagesBeanDefinition(Collection<String> packageNames) {
setBeanClass(EntityScanPackages.class); setBeanClass(EntityScanPackages.class);
......
...@@ -67,7 +67,7 @@ public class LdapProperties { ...@@ -67,7 +67,7 @@ public class LdapProperties {
*/ */
private final Map<String, String> baseEnvironment = new HashMap<>(); private final Map<String, String> baseEnvironment = new HashMap<>();
private Template template = new Template(); private final Template template = new Template();
public String[] getUrls() { public String[] getUrls() {
return this.urls; return this.urls;
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -63,7 +63,7 @@ public class SecurityProperties { ...@@ -63,7 +63,7 @@ public class SecurityProperties {
private final Filter filter = new Filter(); private final Filter filter = new Filter();
private User user = new User(); private final User user = new User();
public User getUser() { public User getUser() {
return this.user; return this.user;
......
...@@ -39,7 +39,7 @@ public class Saml2RelyingPartyProperties { ...@@ -39,7 +39,7 @@ public class Saml2RelyingPartyProperties {
/** /**
* SAML2 relying party registrations. * SAML2 relying party registrations.
*/ */
private Map<String, Registration> registration = new LinkedHashMap<>(); private final Map<String, Registration> registration = new LinkedHashMap<>();
public Map<String, Registration> getRegistration() { public Map<String, Registration> getRegistration() {
return this.registration; return this.registration;
...@@ -62,7 +62,7 @@ public class Saml2RelyingPartyProperties { ...@@ -62,7 +62,7 @@ public class Saml2RelyingPartyProperties {
/** /**
* Remote SAML Identity Provider. * Remote SAML Identity Provider.
*/ */
private Identityprovider identityprovider = new Identityprovider(); private final Identityprovider identityprovider = new Identityprovider();
public String getRelyingPartyEntityId() { public String getRelyingPartyEntityId() {
return this.relyingPartyEntityId; return this.relyingPartyEntityId;
...@@ -92,6 +92,10 @@ public class Saml2RelyingPartyProperties { ...@@ -92,6 +92,10 @@ public class Saml2RelyingPartyProperties {
return this.credentials; return this.credentials;
} }
public void setCredentials(List<Credential> credentials) {
this.credentials = credentials;
}
public static class Credential { public static class Credential {
/** /**
...@@ -136,9 +140,9 @@ public class Saml2RelyingPartyProperties { ...@@ -136,9 +140,9 @@ public class Saml2RelyingPartyProperties {
*/ */
private String entityId; private String entityId;
private Singlesignon singlesignon = new Singlesignon(); private final Singlesignon singlesignon = new Singlesignon();
private Verification verification = new Verification(); private final Verification verification = new Verification();
public String getEntityId() { public String getEntityId() {
return this.entityId; return this.entityId;
...@@ -227,6 +231,10 @@ public class Saml2RelyingPartyProperties { ...@@ -227,6 +231,10 @@ public class Saml2RelyingPartyProperties {
return this.credentials; return this.credentials;
} }
public void setCredentials(List<Credential> credentials) {
this.credentials = credentials;
}
public static class Credential { public static class Credential {
/** /**
......
...@@ -54,7 +54,7 @@ public class HttpHandlerAutoConfiguration { ...@@ -54,7 +54,7 @@ public class HttpHandlerAutoConfiguration {
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
public static class AnnotationConfig { public static class AnnotationConfig {
private ApplicationContext applicationContext; private final ApplicationContext applicationContext;
public AnnotationConfig(ApplicationContext applicationContext) { public AnnotationConfig(ApplicationContext applicationContext) {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
......
...@@ -43,7 +43,7 @@ import static org.mockito.Mockito.mock; ...@@ -43,7 +43,7 @@ import static org.mockito.Mockito.mock;
*/ */
class ElasticsearchDataAutoConfigurationTests { class ElasticsearchDataAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class,
ReactiveElasticsearchRestClientAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class)); ReactiveElasticsearchRestClientAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class));
......
...@@ -51,7 +51,7 @@ class ElasticsearchRepositoriesAutoConfigurationTests { ...@@ -51,7 +51,7 @@ class ElasticsearchRepositoriesAutoConfigurationTests {
static final ElasticsearchContainer elasticsearch = new VersionOverridingElasticsearchContainer() static final ElasticsearchContainer elasticsearch = new VersionOverridingElasticsearchContainer()
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10)); .withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class,
ElasticsearchRepositoriesAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class)) ElasticsearchRepositoriesAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class))
.withPropertyValues("spring.elasticsearch.rest.uris=" + elasticsearch.getHttpHostAddress()); .withPropertyValues("spring.elasticsearch.rest.uris=" + elasticsearch.getHttpHostAddress());
......
...@@ -50,7 +50,7 @@ public class ReactiveElasticsearchRepositoriesAutoConfigurationTests { ...@@ -50,7 +50,7 @@ public class ReactiveElasticsearchRepositoriesAutoConfigurationTests {
static ElasticsearchContainer elasticsearch = new VersionOverridingElasticsearchContainer().withStartupAttempts(5) static ElasticsearchContainer elasticsearch = new VersionOverridingElasticsearchContainer().withStartupAttempts(5)
.withStartupTimeout(Duration.ofMinutes(10)); .withStartupTimeout(Duration.ofMinutes(10));
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class,
ReactiveElasticsearchRepositoriesAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class)) ReactiveElasticsearchRepositoriesAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class))
.withPropertyValues("spring.data.elasticsearch.client.reactive.endpoints=" + elasticsearch.getHost() + ":" .withPropertyValues("spring.data.elasticsearch.client.reactive.endpoints=" + elasticsearch.getHost() + ":"
......
...@@ -50,7 +50,7 @@ public class ReactiveElasticsearchRestClientAutoConfigurationTests { ...@@ -50,7 +50,7 @@ public class ReactiveElasticsearchRestClientAutoConfigurationTests {
static ElasticsearchContainer elasticsearch = new VersionOverridingElasticsearchContainer().withStartupAttempts(5) static ElasticsearchContainer elasticsearch = new VersionOverridingElasticsearchContainer().withStartupAttempts(5)
.withStartupTimeout(Duration.ofMinutes(10)); .withStartupTimeout(Duration.ofMinutes(10));
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class RedisReactiveAutoConfigurationTests { class RedisReactiveAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration( private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(
AutoConfigurations.of(RedisAutoConfiguration.class, RedisReactiveAutoConfiguration.class)); AutoConfigurations.of(RedisAutoConfiguration.class, RedisReactiveAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ClassPathOverrides("org.flywaydb:flyway-core:5.2.4") @ClassPathOverrides("org.flywaydb:flyway-core:5.2.4")
class Flyway5xAutoConfigurationTests { class Flyway5xAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(FlywayAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(FlywayAutoConfiguration.class))
.withPropertyValues("spring.datasource.generate-unique-name=true"); .withPropertyValues("spring.datasource.generate-unique-name=true");
......
...@@ -82,7 +82,7 @@ import static org.mockito.Mockito.mock; ...@@ -82,7 +82,7 @@ import static org.mockito.Mockito.mock;
@ExtendWith(OutputCaptureExtension.class) @ExtendWith(OutputCaptureExtension.class)
class FlywayAutoConfigurationTests { class FlywayAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(FlywayAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(FlywayAutoConfiguration.class))
.withPropertyValues("spring.datasource.generate-unique-name=true"); .withPropertyValues("spring.datasource.generate-unique-name=true");
......
...@@ -52,7 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -52,7 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class HypermediaAutoConfigurationTests { class HypermediaAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withUserConfiguration(BaseConfig.class); .withUserConfiguration(BaseConfig.class);
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -48,7 +48,7 @@ class HazelcastJpaDependencyAutoConfigurationTests { ...@@ -48,7 +48,7 @@ class HazelcastJpaDependencyAutoConfigurationTests {
private static final String POST_PROCESSOR_BEAN_NAME = HazelcastInstanceEntityManagerFactoryDependsOnPostProcessor.class private static final String POST_PROCESSOR_BEAN_NAME = HazelcastInstanceEntityManagerFactoryDependsOnPostProcessor.class
.getName(); .getName();
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class, HazelcastJpaDependencyAutoConfiguration.class)) HibernateJpaAutoConfiguration.class, HazelcastJpaDependencyAutoConfiguration.class))
.withPropertyValues("spring.datasource.generate-unique-name=true", .withPropertyValues("spring.datasource.generate-unique-name=true",
......
...@@ -65,7 +65,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -65,7 +65,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class HttpMessageConvertersAutoConfigurationTests { class HttpMessageConvertersAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HttpMessageConvertersAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(HttpMessageConvertersAutoConfiguration.class));
@Test @Test
......
...@@ -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 CodecsAutoConfigurationTests { class CodecsAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(CodecsAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(CodecsAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class ProjectInfoAutoConfigurationTests { class ProjectInfoAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration( private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(
AutoConfigurations.of(PropertyPlaceholderAutoConfiguration.class, ProjectInfoAutoConfiguration.class)); AutoConfigurations.of(PropertyPlaceholderAutoConfiguration.class, ProjectInfoAutoConfiguration.class));
@Test @Test
......
...@@ -70,7 +70,7 @@ import static org.mockito.Mockito.mock; ...@@ -70,7 +70,7 @@ import static org.mockito.Mockito.mock;
*/ */
class IntegrationAutoConfigurationTests { class IntegrationAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(JmxAutoConfiguration.class, IntegrationAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(JmxAutoConfiguration.class, IntegrationAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -57,7 +57,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; ...@@ -57,7 +57,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
*/ */
class DataSourceInitializerInvokerTests { class DataSourceInitializerInvokerTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
.withPropertyValues("spring.datasource.initialization-mode=never", .withPropertyValues("spring.datasource.initialization-mode=never",
"spring.datasource.url:jdbc:hsqldb:mem:init-" + UUID.randomUUID()); "spring.datasource.url:jdbc:hsqldb:mem:init-" + UUID.randomUUID());
......
...@@ -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 HikariDataSourceConfigurationTests { class HikariDataSourceConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
.withPropertyValues("spring.datasource.initialization-mode=never", .withPropertyValues("spring.datasource.initialization-mode=never",
"spring.datasource.type=" + HikariDataSource.class.getName()); "spring.datasource.type=" + HikariDataSource.class.getName());
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -65,7 +65,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; ...@@ -65,7 +65,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
*/ */
class JooqAutoConfigurationTests { class JooqAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(JooqAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(JooqAutoConfiguration.class))
.withPropertyValues("spring.datasource.name:jooqtest"); .withPropertyValues("spring.datasource.name:jooqtest");
......
...@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class ApplicationAvailabilityAutoConfigurationTests { class ApplicationAvailabilityAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ApplicationAvailabilityAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ApplicationAvailabilityAutoConfiguration.class));
@Test @Test
......
...@@ -42,7 +42,7 @@ import static org.mockito.Mockito.mock; ...@@ -42,7 +42,7 @@ import static org.mockito.Mockito.mock;
*/ */
class LdapAutoConfigurationTests { class LdapAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(LdapAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(LdapAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -62,8 +62,9 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -62,8 +62,9 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class ReactiveOAuth2ClientAutoConfigurationTests { class ReactiveOAuth2ClientAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.of(ReactiveOAuth2ClientAutoConfiguration.class, ReactiveSecurityAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ReactiveOAuth2ClientAutoConfiguration.class,
ReactiveSecurityAutoConfiguration.class));
private static final String REGISTRATION_PREFIX = "spring.security.oauth2.client.registration"; private static final String REGISTRATION_PREFIX = "spring.security.oauth2.client.registration";
......
...@@ -74,7 +74,7 @@ import static org.mockito.Mockito.mock; ...@@ -74,7 +74,7 @@ import static org.mockito.Mockito.mock;
*/ */
class ReactiveOAuth2ResourceServerAutoConfigurationTests { class ReactiveOAuth2ResourceServerAutoConfigurationTests {
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ReactiveOAuth2ResourceServerAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(ReactiveOAuth2ResourceServerAutoConfiguration.class))
.withUserConfiguration(TestConfig.class); .withUserConfiguration(TestConfig.class);
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -38,7 +38,7 @@ import static org.mockito.Mockito.mock; ...@@ -38,7 +38,7 @@ import static org.mockito.Mockito.mock;
*/ */
class ReactiveSecurityAutoConfigurationTests { class ReactiveSecurityAutoConfigurationTests {
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(); private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner();
@Test @Test
void backsOffWhenWebFilterChainProxyBeanPresent() { void backsOffWhenWebFilterChainProxyBeanPresent() {
......
...@@ -39,9 +39,10 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -39,9 +39,10 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class RSocketSecurityAutoConfigurationTests { class RSocketSecurityAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.of(ReactiveUserDetailsServiceAutoConfiguration.class, RSocketSecurityAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ReactiveUserDetailsServiceAutoConfiguration.class,
RSocketMessagingAutoConfiguration.class, RSocketStrategiesAutoConfiguration.class)); RSocketSecurityAutoConfiguration.class, RSocketMessagingAutoConfiguration.class,
RSocketStrategiesAutoConfiguration.class));
@Test @Test
void autoConfigurationEnablesRSocketSecurity() { void autoConfigurationEnablesRSocketSecurity() {
......
...@@ -51,7 +51,7 @@ public class Saml2RelyingPartyAutoConfigurationTests { ...@@ -51,7 +51,7 @@ public class Saml2RelyingPartyAutoConfigurationTests {
private static final String PREFIX = "spring.security.saml2.relyingparty.registration"; private static final String PREFIX = "spring.security.saml2.relyingparty.registration";
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner().withConfiguration( private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner().withConfiguration(
AutoConfigurations.of(Saml2RelyingPartyAutoConfiguration.class, SecurityAutoConfiguration.class)); AutoConfigurations.of(Saml2RelyingPartyAutoConfiguration.class, SecurityAutoConfiguration.class));
@Test @Test
......
...@@ -56,7 +56,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -56,7 +56,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class SecurityAutoConfigurationTests { class SecurityAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner().withConfiguration( private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner().withConfiguration(
AutoConfigurations.of(SecurityAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class)); AutoConfigurations.of(SecurityAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class));
@Test @Test
......
...@@ -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 TaskSchedulingAutoConfigurationTests { class TaskSchedulingAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withUserConfiguration(TestConfiguration.class) .withUserConfiguration(TestConfiguration.class)
.withConfiguration(AutoConfigurations.of(TaskSchedulingAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(TaskSchedulingAutoConfiguration.class));
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -63,7 +63,7 @@ class ThymeleafReactiveAutoConfigurationTests { ...@@ -63,7 +63,7 @@ class ThymeleafReactiveAutoConfigurationTests {
private final BuildOutput buildOutput = new BuildOutput(getClass()); private final BuildOutput buildOutput = new BuildOutput(getClass());
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ThymeleafAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ThymeleafAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -46,7 +46,7 @@ import static org.mockito.Mockito.verify; ...@@ -46,7 +46,7 @@ import static org.mockito.Mockito.verify;
*/ */
class ValidatorAdapterTests { class ValidatorAdapterTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner(); private final ApplicationContextRunner contextRunner = new ApplicationContextRunner();
@Test @Test
void wrapLocalValidatorFactoryBean() { void wrapLocalValidatorFactoryBean() {
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class ResourcePropertiesBindingTests { class ResourcePropertiesBindingTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withUserConfiguration(TestConfiguration.class); .withUserConfiguration(TestConfiguration.class);
@Test @Test
......
...@@ -66,7 +66,7 @@ import static org.mockito.Mockito.verify; ...@@ -66,7 +66,7 @@ import static org.mockito.Mockito.verify;
*/ */
class ReactiveWebServerFactoryAutoConfigurationTests { class ReactiveWebServerFactoryAutoConfigurationTests {
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner( private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(
AnnotationConfigReactiveWebServerApplicationContext::new) AnnotationConfigReactiveWebServerApplicationContext::new)
.withConfiguration(AutoConfigurations.of(ReactiveWebServerFactoryAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ReactiveWebServerFactoryAutoConfiguration.class));
......
...@@ -91,7 +91,7 @@ class WebFluxAutoConfigurationTests { ...@@ -91,7 +91,7 @@ class WebFluxAutoConfigurationTests {
private static final MockReactiveWebServerFactory mockReactiveWebServerFactory = new MockReactiveWebServerFactory(); private static final MockReactiveWebServerFactory mockReactiveWebServerFactory = new MockReactiveWebServerFactory();
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class))
.withUserConfiguration(Config.class); .withUserConfiguration(Config.class);
......
...@@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify; ...@@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify;
*/ */
class ClientHttpConnectorAutoConfigurationTests { class ClientHttpConnectorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ClientHttpConnectorAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ClientHttpConnectorAutoConfiguration.class));
@Test @Test
......
...@@ -50,7 +50,7 @@ import static org.mockito.Mockito.verify; ...@@ -50,7 +50,7 @@ import static org.mockito.Mockito.verify;
*/ */
class WebClientAutoConfigurationTests { class WebClientAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration( private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(
AutoConfigurations.of(ClientHttpConnectorAutoConfiguration.class, WebClientAutoConfiguration.class)); AutoConfigurations.of(ClientHttpConnectorAutoConfiguration.class, WebClientAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -46,7 +46,7 @@ import static org.mockito.Mockito.mock; ...@@ -46,7 +46,7 @@ import static org.mockito.Mockito.mock;
*/ */
class DispatcherServletAutoConfigurationTests { class DispatcherServletAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(DispatcherServletAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(DispatcherServletAutoConfiguration.class));
@Test @Test
......
...@@ -79,7 +79,7 @@ import static org.mockito.Mockito.verify; ...@@ -79,7 +79,7 @@ import static org.mockito.Mockito.verify;
*/ */
class ServletWebServerFactoryAutoConfigurationTests { class ServletWebServerFactoryAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner( private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner(
AnnotationConfigServletWebServerApplicationContext::new) AnnotationConfigServletWebServerApplicationContext::new)
.withConfiguration(AutoConfigurations.of(ServletWebServerFactoryAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ServletWebServerFactoryAutoConfiguration.class,
DispatcherServletAutoConfiguration.class)) DispatcherServletAutoConfiguration.class))
......
...@@ -212,9 +212,9 @@ class BasicErrorControllerMockMvcTests { ...@@ -212,9 +212,9 @@ class BasicErrorControllerMockMvcTests {
private class ErrorDispatcher implements RequestBuilder { private class ErrorDispatcher implements RequestBuilder {
private MvcResult result; private final MvcResult result;
private String path; private final String path;
ErrorDispatcher(MvcResult result, String path) { ErrorDispatcher(MvcResult result, String path) {
this.result = result; this.result = result;
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -104,7 +104,7 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio ...@@ -104,7 +104,7 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
private final SourceUnit source; private final SourceUnit source;
private List<AnnotationNode> annotationNodes; private final List<AnnotationNode> annotationNodes;
ClassVisitor(SourceUnit source, List<AnnotationNode> annotationNodes) { ClassVisitor(SourceUnit source, List<AnnotationNode> annotationNodes) {
this.source = source; this.source = source;
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -31,7 +31,7 @@ import java.net.URLStreamHandler; ...@@ -31,7 +31,7 @@ import java.net.URLStreamHandler;
*/ */
public class ClassLoaderFileURLStreamHandler extends URLStreamHandler { public class ClassLoaderFileURLStreamHandler extends URLStreamHandler {
private ClassLoaderFile file; private final ClassLoaderFile file;
public ClassLoaderFileURLStreamHandler(ClassLoaderFile file) { public ClassLoaderFileURLStreamHandler(ClassLoaderFile file) {
this.file = file; this.file = file;
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,7 +33,7 @@ public class ExampleService { ...@@ -33,7 +33,7 @@ public class ExampleService {
private static final Charset CHARSET = StandardCharsets.UTF_8; private static final Charset CHARSET = StandardCharsets.UTF_8;
private RedisOperations<Object, Object> operations; private final RedisOperations<Object, Object> operations;
public ExampleService(RedisOperations<Object, Object> operations) { public ExampleService(RedisOperations<Object, Object> operations) {
this.operations = operations; this.operations = operations;
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -28,7 +28,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -28,7 +28,7 @@ import org.springframework.web.client.RestTemplate;
@Service @Service
public class AnotherExampleRestClient { public class AnotherExampleRestClient {
private RestTemplate restTemplate; private final RestTemplate restTemplate;
public AnotherExampleRestClient(RestTemplateBuilder builder) { public AnotherExampleRestClient(RestTemplateBuilder builder) {
this.restTemplate = builder.rootUri("https://example.com").build(); this.restTemplate = builder.rootUri("https://example.com").build();
......
...@@ -49,7 +49,7 @@ import static org.mockito.Mockito.verify; ...@@ -49,7 +49,7 @@ import static org.mockito.Mockito.verify;
*/ */
class WebTestClientAutoConfigurationTests { class WebTestClientAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(WebTestClientAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(WebTestClientAutoConfiguration.class));
@Test @Test
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
class MockMvcAutoConfigurationTests { class MockMvcAutoConfigurationTests {
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MockMvcAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(MockMvcAutoConfiguration.class));
@Test @Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment