Remove public modifier on JUnit5 lifecycle methods

See gh-17292
This commit is contained in:
Stephane Nicoll 2019-06-21 18:09:05 +02:00
parent c7d3b7a9f1
commit e560b7f6ba
310 changed files with 361 additions and 362 deletions

View File

@ -46,7 +46,7 @@ class SpringApplicationHierarchyTests {
private ConfigurableApplicationContext context;
@AfterEach
public void after() {
void after() {
ApplicationContextTestUtils.closeAll(this.context);
}

View File

@ -92,7 +92,7 @@ class ReactiveCloudFoundryActuatorAutoConfigurationTests {
ProjectInfoAutoConfiguration.class, ReactiveCloudFoundryActuatorAutoConfiguration.class));
@AfterEach
public void close() {
void close() {
HttpResources.reset();
}

View File

@ -52,7 +52,7 @@ class ReactiveCloudFoundrySecurityInterceptorTests {
private CloudFoundrySecurityInterceptor interceptor;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.interceptor = new CloudFoundrySecurityInterceptor(this.tokenValidator, this.securityService, "my-app-id");
}

View File

@ -54,14 +54,14 @@ class ReactiveCloudFoundrySecurityServiceTests {
private WebClient.Builder builder;
@BeforeEach
public void setup() {
void setup() {
this.server = new MockWebServer();
this.builder = WebClient.builder().baseUrl(this.server.url("/").toString());
this.securityService = new ReactiveCloudFoundrySecurityService(this.builder, CLOUD_CONTROLLER, false);
}
@AfterEach
public void shutdown() throws Exception {
void shutdown() throws Exception {
this.server.shutdown();
}

View File

@ -84,7 +84,7 @@ class ReactiveTokenValidatorTests {
private static final Map<String, String> VALID_KEYS = new ConcurrentHashMap<>();
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
VALID_KEYS.put("valid-key", VALID_KEY);
INVALID_KEYS.put("invalid-key", INVALID_KEY);

View File

@ -54,7 +54,7 @@ class CloudFoundrySecurityInterceptorTests {
private MockHttpServletRequest request;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.interceptor = new CloudFoundrySecurityInterceptor(this.tokenValidator, this.securityService, "my-app-id");
this.request = new MockHttpServletRequest();

View File

@ -60,7 +60,7 @@ class CloudFoundrySecurityServiceTests {
private MockRestServiceServer server;
@BeforeEach
public void setup() {
void setup() {
MockServerRestTemplateCustomizer mockServerCustomizer = new MockServerRestTemplateCustomizer();
RestTemplateBuilder builder = new RestTemplateBuilder(mockServerCustomizer);
this.securityService = new CloudFoundrySecurityService(builder, CLOUD_CONTROLLER, false);

View File

@ -42,7 +42,7 @@ class SkipSslVerificationHttpRequestFactoryTests {
private WebServer webServer;
@AfterEach
public void shutdownContainer() {
void shutdownContainer() {
if (this.webServer != null) {
this.webServer.stop();
}

View File

@ -84,7 +84,7 @@ class TokenValidatorTests {
private static final Map<String, String> VALID_KEYS = Collections.singletonMap("valid-key", VALID_KEY);
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.tokenValidator = new TokenValidator(this.securityService);
}

View File

@ -41,7 +41,7 @@ class ExposeExcludePropertyEndpointFilterTests {
private ExposeExcludePropertyEndpointFilter<?> filter;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
}

View File

@ -58,7 +58,7 @@ class ConditionsReportEndpointDocumentationTests extends MockMvcEndpointDocument
@Override
@BeforeEach
public void setup(RestDocumentationContextProvider restDocumentation) {
void setup(RestDocumentationContextProvider restDocumentation) {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.applicationContext)
.apply(MockMvcRestDocumentation.documentationConfiguration(restDocumentation).uris()).build();
}

View File

@ -70,7 +70,7 @@ class MappingsEndpointReactiveDocumentationTests extends AbstractEndpointDocumen
private WebTestClient client;
@BeforeEach
public void webTestClient(RestDocumentationContextProvider restDocumentation) {
void webTestClient(RestDocumentationContextProvider restDocumentation) {
this.client = WebTestClient.bindToServer()
.filter(documentationConfiguration(restDocumentation).snippets().withDefaults())
.baseUrl("http://localhost:" + this.port).build();

View File

@ -70,7 +70,7 @@ class MappingsEndpointServletDocumentationTests extends AbstractEndpointDocument
private WebTestClient client;
@BeforeEach
public void webTestClient(RestDocumentationContextProvider restDocumentation) {
void webTestClient(RestDocumentationContextProvider restDocumentation) {
this.client = WebTestClient.bindToServer().filter(documentationConfiguration(restDocumentation))
.baseUrl("http://localhost:" + this.port).build();
}

View File

@ -44,7 +44,7 @@ public abstract class MockMvcEndpointDocumentationTests extends AbstractEndpoint
private WebApplicationContext applicationContext;
@BeforeEach
public void setup(RestDocumentationContextProvider restDocumentation) {
void setup(RestDocumentationContextProvider restDocumentation) {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.applicationContext)
.apply(MockMvcRestDocumentation.documentationConfiguration(restDocumentation).uris()).build();
}

View File

@ -45,7 +45,7 @@ class InfoContributorAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -50,7 +50,7 @@ class ControllerEndpointWebFluxIntegrationTests {
private AnnotationConfigReactiveWebApplicationContext context;
@AfterEach
public void close() {
void close() {
TestSecurityContextHolder.clearContext();
this.context.close();
}

View File

@ -63,7 +63,7 @@ class ControllerEndpointWebMvcIntegrationTests {
private AnnotationConfigServletWebApplicationContext context;
@AfterEach
public void close() {
void close() {
TestSecurityContextHolder.clearContext();
this.context.close();
}

View File

@ -73,7 +73,7 @@ class WebMvcEndpointIntegrationTests {
private AnnotationConfigServletWebApplicationContext context;
@AfterEach
public void close() {
void close() {
TestSecurityContextHolder.clearContext();
this.context.close();
}

View File

@ -70,7 +70,7 @@ class MeterRegistryConfigurerTests {
private Config mockConfig;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
given(this.mockRegistry.config()).willReturn(this.mockConfig);
}

View File

@ -50,7 +50,7 @@ class RabbitHealthIndicatorTests {
private Channel channel;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
given(this.rabbitTemplate.execute(any())).willAnswer((invocation) -> {
ChannelCallback<?> callback = invocation.getArgument(0);

View File

@ -64,7 +64,7 @@ class ElasticsearchHealthIndicatorTests {
private ElasticsearchHealthIndicator indicator;
@BeforeEach
public void setUp() {
void setUp() {
MockitoAnnotations.initMocks(this);
given(this.client.admin()).willReturn(this.admin);
given(this.admin.cluster()).willReturn(this.cluster);

View File

@ -52,7 +52,7 @@ class DiscoveredOperationsFactoryTests {
private List<OperationInvokerAdvisor> invokerAdvisors;
@BeforeEach
public void setup() {
void setup() {
this.parameterValueMapper = (parameter, value) -> value.toString();
this.invokerAdvisors = new ArrayList<>();
this.factory = new TestDiscoveredOperationsFactory(this.parameterValueMapper, this.invokerAdvisors);

View File

@ -48,7 +48,7 @@ class ReflectiveOperationInvokerTests {
private ParameterValueMapper parameterValueMapper;
@BeforeEach
public void setup() {
void setup() {
this.target = new Example();
this.operationMethod = new OperationMethod(ReflectionUtils.findMethod(Example.class, "reverse", String.class),
OperationType.READ);

View File

@ -55,7 +55,7 @@ class CachingOperationInvokerAdvisorTests {
private CachingOperationInvokerAdvisor advisor;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.advisor = new CachingOperationInvokerAdvisor(this.timeToLive);
}

View File

@ -71,7 +71,7 @@ class JmxEndpointExporterTests {
private JmxEndpointExporter exporter;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.exporter = new JmxEndpointExporter(this.mBeanServer, this.objectNameFactory, this.responseMapper,
this.endpoints);

View File

@ -61,7 +61,7 @@ class ServletEndpointRegistrarTests {
private ArgumentCaptor<Servlet> servlet;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
given(this.servletContext.addServlet(any(String.class), any(Servlet.class))).willReturn(this.dynamic);
}

View File

@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat;
class EnvironmentEndpointTests {
@AfterEach
public void close() {
void close() {
System.clearProperty("VCAP_SERVICES");
}

View File

@ -37,7 +37,7 @@ class EnvironmentEndpointWebIntegrationTests {
private WebTestClient client;
@BeforeEach
public void prepareEnvironment(ConfigurableApplicationContext context, WebTestClient client) {
void prepareEnvironment(ConfigurableApplicationContext context, WebTestClient client) {
TestPropertyValues.of("foo:bar", "fool:baz").applyTo(context);
this.client = client;
this.context = context;

View File

@ -47,7 +47,7 @@ class CompositeHealthIndicatorTests {
private HealthIndicator two;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
given(this.one.health()).willReturn(new Health.Builder().unknown().withDetail("1", "1").build());
given(this.two.health()).willReturn(new Health.Builder().unknown().withDetail("2", "2").build());

View File

@ -42,7 +42,7 @@ class DefaultHealthIndicatorRegistryTests {
private DefaultHealthIndicatorRegistry registry;
@BeforeEach
public void setUp() {
void setUp() {
given(this.one.health()).willReturn(new Health.Builder().unknown().withDetail("1", "1").build());
given(this.two.health()).willReturn(new Health.Builder().unknown().withDetail("2", "2").build());
this.registry = new DefaultHealthIndicatorRegistry();

View File

@ -43,7 +43,7 @@ class DefaultReactiveHealthIndicatorRegistryTests {
private DefaultReactiveHealthIndicatorRegistry registry;
@BeforeEach
public void setUp() {
void setUp() {
given(this.one.health()).willReturn(Mono.just(new Health.Builder().unknown().withDetail("1", "1").build()));
given(this.two.health()).willReturn(Mono.just(new Health.Builder().unknown().withDetail("2", "2").build()));
this.registry = new DefaultReactiveHealthIndicatorRegistry();

View File

@ -35,7 +35,7 @@ class OrderedHealthAggregatorTests {
private OrderedHealthAggregator healthAggregator;
@BeforeEach
public void setup() {
void setup() {
this.healthAggregator = new OrderedHealthAggregator();
}

View File

@ -44,7 +44,7 @@ class IntegrationGraphEndpointTests {
private IntegrationGraphEndpoint integrationGraphEndpoint;
@BeforeEach
public void setUp() {
void setUp() {
MockitoAnnotations.initMocks(this);
}

View File

@ -51,14 +51,14 @@ class DataSourceHealthIndicatorTests {
private SingleConnectionDataSource dataSource;
@BeforeEach
public void init() {
void init() {
EmbeddedDatabaseConnection db = EmbeddedDatabaseConnection.HSQL;
this.dataSource = new SingleConnectionDataSource(db.getUrl("testdb") + ";shutdown=true", "sa", "", false);
this.dataSource.setDriverClassName(db.getDriverClassName());
}
@AfterEach
public void close() {
void close() {
if (this.dataSource != null) {
this.dataSource.destroy();
}

View File

@ -50,7 +50,7 @@ class LogFileWebEndpointTests {
private File logFile;
@BeforeEach
public void before(@TempDir Path temp) throws IOException {
void before(@TempDir Path temp) throws IOException {
this.logFile = Files.createTempFile(temp, "junit", null).toFile();
FileCopyUtils.copy("--TEST--".getBytes(), this.logFile);
}

View File

@ -47,8 +47,7 @@ class LogFileWebEndpointWebIntegrationTests {
private File logFile;
@BeforeEach
public void setUp(@TempDir File temp, WebTestClient client, ConfigurableApplicationContext context)
throws IOException {
void setUp(@TempDir File temp, WebTestClient client, ConfigurableApplicationContext context) throws IOException {
this.logFile = new File(temp, "test.log");
this.client = client;
this.context = context;

View File

@ -59,7 +59,7 @@ class LoggersEndpointWebIntegrationTests {
@BeforeEach
@AfterEach
public void resetMocks(ConfigurableApplicationContext context, WebTestClient client) {
void resetMocks(ConfigurableApplicationContext context, WebTestClient client) {
this.client = client;
this.loggingSystem = context.getBean(LoggingSystem.class);
Mockito.reset(this.loggingSystem);

View File

@ -52,7 +52,7 @@ class MailHealthIndicatorTests {
private MailHealthIndicator indicator;
@BeforeEach
public void setup() {
void setup() {
Session session = Session.getDefaultInstance(new Properties());
session.addProvider(new Provider(Type.TRANSPORT, "success", SuccessTransport.class.getName(), "Test", "1.0.0"));
this.mailSender = mock(JavaMailSenderImpl.class);

View File

@ -45,7 +45,7 @@ class HeapDumpWebEndpointWebIntegrationTests {
private TestHeapDumpWebEndpoint endpoint;
@BeforeEach
public void configureEndpoint(ApplicationContext context) {
void configureEndpoint(ApplicationContext context) {
this.endpoint = context.getBean(TestHeapDumpWebEndpoint.class);
this.endpoint.setAvailable(true);
}

View File

@ -72,7 +72,7 @@ class PrometheusPushGatewayManagerTests {
private ScheduledFuture<Object> future;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.scheduler = mockScheduler(TaskScheduler.class);
}

View File

@ -54,7 +54,7 @@ class MetricsRestTemplateCustomizerTests {
private MetricsRestTemplateCustomizer customizer;
@BeforeEach
public void setup() {
void setup() {
this.registry = new SimpleMeterRegistry(SimpleConfig.DEFAULT, new MockClock());
this.restTemplate = new RestTemplate();
this.mockServer = MockRestServiceServer.createServer(this.restTemplate);

View File

@ -50,7 +50,7 @@ class DefaultWebClientExchangeTagsProviderTests {
private ClientResponse response;
@BeforeEach
public void setup() {
void setup() {
this.request = ClientRequest.create(HttpMethod.GET, URI.create("https://example.org/projects/spring-boot"))
.attribute(URI_TEMPLATE_ATTRIBUTE, "https://example.org/projects/{project}").build();
this.response = mock(ClientResponse.class);

View File

@ -38,7 +38,7 @@ class MetricsWebClientCustomizerTests {
private WebClient.Builder clientBuilder;
@BeforeEach
public void setup() {
void setup() {
this.customizer = new MetricsWebClientCustomizer(mock(MeterRegistry.class),
mock(WebClientExchangeTagsProvider.class), "test", null);
this.clientBuilder = WebClient.builder();

View File

@ -60,7 +60,7 @@ class MetricsWebClientFilterFunctionTests {
private ExchangeFunction exchange;
@BeforeEach
public void setup() {
void setup() {
this.registry = new SimpleMeterRegistry(SimpleConfig.DEFAULT, new MockClock());
this.filterFunction = new MetricsWebClientFilterFunction(this.registry,
new DefaultWebClientExchangeTagsProvider(), "http.client.requests", AutoTimer.ENABLED);

View File

@ -48,7 +48,7 @@ class WebClientExchangeTagsTests {
private ClientResponse response;
@BeforeEach
public void setup() {
void setup() {
this.request = ClientRequest.create(HttpMethod.GET, URI.create("https://example.org/projects/spring-boot"))
.attribute(URI_TEMPLATE_ATTRIBUTE, "https://example.org/projects/{project}").build();
this.response = mock(ClientResponse.class);

View File

@ -47,7 +47,7 @@ class MetricsWebFilterTests {
private MetricsWebFilter webFilter;
@BeforeEach
public void setup() {
void setup() {
MockClock clock = new MockClock();
this.registry = new SimpleMeterRegistry(SimpleConfig.DEFAULT, clock);
this.webFilter = new MetricsWebFilter(this.registry, new DefaultWebFluxTagsProvider(), REQUEST_METRICS_NAME,

View File

@ -45,7 +45,7 @@ class WebFluxTagsTests {
private PathPatternParser parser = new PathPatternParser();
@BeforeEach
public void setup() {
void setup() {
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get(""));
}

View File

@ -79,7 +79,7 @@ class LongTaskTimingHandlerInterceptorTests {
private MockMvc mvc;
@BeforeEach
public void setUpMockMvc() {
void setUpMockMvc() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
}

View File

@ -68,7 +68,7 @@ class WebMvcMetricsFilterAutoTimedTests {
private WebMvcMetricsFilter filter;
@BeforeEach
public void setupMockMvc() {
void setupMockMvc() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).addFilters(this.filter).build();
}

View File

@ -121,7 +121,7 @@ class WebMvcMetricsFilterTests {
private CyclicBarrier completableFutureBarrier;
@BeforeEach
public void setupMockMvc() {
void setupMockMvc() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context)
.addFilters(this.filter, new RedirectAndNotFoundFilter()).build();
}

View File

@ -72,7 +72,7 @@ class WebMvcMetricsIntegrationTests {
private MockMvc mvc;
@BeforeEach
public void setupMockMvc() {
void setupMockMvc() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).addFilters(this.filter).build();
}

View File

@ -41,7 +41,7 @@ class MongoHealthIndicatorTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -50,7 +50,7 @@ class Neo4jHealthIndicatorTests {
private Neo4jHealthIndicator neo4jHealthIndicator;
@BeforeEach
public void before() {
void before() {
this.session = mock(Session.class);
SessionFactory sessionFactory = mock(SessionFactory.class);
given(sessionFactory.openSession()).willReturn(this.session);

View File

@ -49,7 +49,7 @@ class AuthenticationAuditListenerTests {
private final ApplicationEventPublisher publisher = mock(ApplicationEventPublisher.class);
@BeforeEach
public void init() {
void init() {
this.listener.setApplicationEventPublisher(this.publisher);
}

View File

@ -46,7 +46,7 @@ class AuthorizationAuditListenerTests {
private final ApplicationEventPublisher publisher = mock(ApplicationEventPublisher.class);
@BeforeEach
public void init() {
void init() {
this.listener.setApplicationEventPublisher(this.publisher);
}

View File

@ -44,7 +44,7 @@ class SolrHealthIndicatorTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -49,7 +49,7 @@ class DiskSpaceHealthIndicatorTests {
private HealthIndicator healthIndicator;
@BeforeEach
public void setUp() {
void setUp() {
MockitoAnnotations.initMocks(this);
given(this.fileMock.exists()).willReturn(true);
given(this.fileMock.canRead()).willReturn(true);

View File

@ -43,7 +43,7 @@ class ServerWebExchangeTraceableRequestTests {
private ServerHttpRequest request;
@BeforeEach
public void setUp() {
void setUp() {
this.exchange = mock(ServerWebExchange.class);
this.request = mock(ServerHttpRequest.class);
given(this.exchange.getRequest()).willReturn(this.request);

View File

@ -32,7 +32,7 @@ class TraceableHttpServletRequestTests {
private MockHttpServletRequest request;
@BeforeEach
public void setup() {
void setup() {
this.request = new MockHttpServletRequest("GET", "/script");
}

View File

@ -45,7 +45,7 @@ class AutoConfigurationExcludeFilterTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void cleanUp() {
void cleanUp() {
if (this.context != null) {
this.context.close();
}

View File

@ -61,7 +61,7 @@ class AutoConfigurationImportSelectorTests {
private List<AutoConfigurationImportFilter> filters = new ArrayList<>();
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.importSelector.setBeanFactory(this.beanFactory);
this.importSelector.setEnvironment(this.environment);

View File

@ -38,7 +38,7 @@ class AutoConfigurationReproTests {
private ConfigurableApplicationContext context;
@AfterEach
public void cleanup() {
void cleanup() {
if (this.context != null) {
this.context.close();
}

View File

@ -78,7 +78,7 @@ class AutoConfigurationSorterTests {
private AutoConfigurationMetadata autoConfigurationMetadata = mock(AutoConfigurationMetadata.class);
@BeforeEach
public void setup() {
void setup() {
this.sorter = new AutoConfigurationSorter(new SkipCycleMetadataReaderFactory(), this.autoConfigurationMetadata);
}

View File

@ -58,7 +58,7 @@ class ImportAutoConfigurationImportSelectorTests {
private Environment environment;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.importSelector.setBeanFactory(this.beanFactory);
this.importSelector.setEnvironment(this.environment);

View File

@ -73,7 +73,7 @@ class JobLauncherCommandLineRunnerTests {
private Step step;
@BeforeEach
public void init() {
void init() {
this.context.register(BatchConfiguration.class);
this.context.refresh();
JobRepository jobRepository = this.context.getBean(JobRepository.class);
@ -90,7 +90,7 @@ class JobLauncherCommandLineRunnerTests {
}
@AfterEach
public void closeContext() {
void closeContext() {
this.context.close();
}

View File

@ -45,7 +45,7 @@ class ConditionEvaluationReportAutoConfigurationImportListenerTests {
private final ConfigurableListableBeanFactory beanFactory = new DefaultListableBeanFactory();
@BeforeEach
public void setup() {
void setup() {
this.listener = new ConditionEvaluationReportAutoConfigurationImportListener();
this.listener.setBeanFactory(this.beanFactory);
}

View File

@ -78,7 +78,7 @@ class ConditionEvaluationReportTests {
private ConditionOutcome outcome3;
@BeforeEach
public void setup() {
void setup() {
MockitoAnnotations.initMocks(this);
this.beanFactory = new DefaultListableBeanFactory();
this.report = ConditionEvaluationReport.get(this.beanFactory);

View File

@ -54,13 +54,13 @@ class ConditionalOnJndiTests {
private MockableOnJndi condition = new MockableOnJndi();
@BeforeEach
public void setupThreadContextClassLoader() {
void setupThreadContextClassLoader() {
this.threadContextClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(new JndiPropertiesHidingClassLoader(getClass().getClassLoader()));
}
@AfterEach
public void close() {
void close() {
TestableInitialContextFactory.clearAll();
if (this.initialContextFactory != null) {
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, this.initialContextFactory);

View File

@ -52,7 +52,7 @@ class ConditionalOnPropertyTests {
private ConfigurableEnvironment environment = new StandardEnvironment();
@AfterEach
public void tearDown() {
void tearDown() {
if (this.context != null) {
this.context.close();
}

View File

@ -38,7 +38,7 @@ class ConditionalOnSingleCandidateTests {
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -46,7 +46,7 @@ class ConditionalOnWebApplicationTests {
private ConfigurableApplicationContext context;
@AfterEach
public void closeContext() {
void closeContext() {
if (this.context != null) {
this.context.close();
}

View File

@ -40,7 +40,7 @@ class OnClassConditionAutoConfigurationImportFilterTests {
private DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
@BeforeEach
public void setup() {
void setup() {
this.filter.setBeanClassLoader(getClass().getClassLoader());
this.filter.setBeanFactory(this.beanFactory);
}

View File

@ -38,7 +38,7 @@ class ResourceConditionTests {
private ConfigurableApplicationContext context;
@AfterEach
public void tearDown() {
void tearDown() {
if (this.context != null) {
this.context.close();
}

View File

@ -38,7 +38,7 @@ class ConfigurationPropertiesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void tearDown() {
void tearDown() {
if (this.context != null) {
this.context.close();
}

View File

@ -39,7 +39,7 @@ class PropertyPlaceholderAutoConfigurationTests {
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -48,7 +48,7 @@ class PersistenceExceptionTranslationAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -50,7 +50,7 @@ class CassandraDataAutoConfigurationIntegrationTests {
private AnnotationConfigApplicationContext context;
@BeforeEach
public void setUp() {
void setUp() {
this.context = new AnnotationConfigApplicationContext();
TestPropertyValues
.of("spring.data.cassandra.port=" + cassandra.getFirstMappedPort(),
@ -59,7 +59,7 @@ class CassandraDataAutoConfigurationIntegrationTests {
}
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -55,7 +55,7 @@ class CassandraDataAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -49,7 +49,7 @@ class CassandraReactiveDataAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -58,7 +58,7 @@ class CouchbaseDataAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -50,7 +50,7 @@ class CouchbaseReactiveAndImperativeRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
this.context.close();
}

View File

@ -58,7 +58,7 @@ class CouchbaseReactiveDataAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -46,7 +46,7 @@ class CouchbaseReactiveRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -44,7 +44,7 @@ class CouchbaseRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -51,12 +51,12 @@ class ElasticsearchAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@BeforeEach
public void setUp() {
void setUp() {
System.setProperty("es.set.netty.runtime.available.processors", "false");
}
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -56,12 +56,12 @@ class ElasticsearchDataAutoConfigurationTests {
ReactiveRestClientAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class));
@BeforeEach
public void setUp() {
void setUp() {
System.setProperty("es.set.netty.runtime.available.processors", "false");
}
@AfterEach
public void tearDown() {
void tearDown() {
System.clearProperty("es.set.netty.runtime.available.processors");
}

View File

@ -46,7 +46,7 @@ class JpaWebAutoConfigurationTests {
private AnnotationConfigServletWebApplicationContext context;
@AfterEach
public void close() {
void close() {
this.context.close();
}

View File

@ -43,7 +43,7 @@ class LdapRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -55,7 +55,7 @@ class MixedMongoRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
this.context.close();
}

View File

@ -50,7 +50,7 @@ class MongoReactiveAndBlockingRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
this.context.close();
}

View File

@ -54,7 +54,7 @@ class MixedNeo4jRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -42,7 +42,7 @@ class Neo4jPropertiesTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -50,7 +50,7 @@ class Neo4jRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
this.context.close();
}

View File

@ -50,12 +50,12 @@ class RedisRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
@BeforeEach
public void setUp() {
void setUp() {
TestPropertyValues.of("spring.redis.port=" + redis.getFirstMappedPort()).applyTo(this.context.getEnvironment());
}
@AfterEach
public void close() {
void close() {
this.context.close();
}

View File

@ -58,7 +58,7 @@ class RepositoryRestMvcAutoConfigurationTests {
private AnnotationConfigServletWebApplicationContext context;
@AfterEach
public void tearDown() {
void tearDown() {
if (this.context != null) {
this.context.close();
}

View File

@ -47,7 +47,7 @@ class SolrRepositoriesAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void close() {
void close() {
this.context.close();
}

View File

@ -41,7 +41,7 @@ class EntityScanPackagesTests {
private AnnotationConfigApplicationContext context;
@AfterEach
public void cleanup() {
void cleanup() {
if (this.context != null) {
this.context.close();
}

View File

@ -60,7 +60,7 @@ class FreeMarkerAutoConfigurationServletIntegrationTests {
private AnnotationConfigServletWebApplicationContext context;
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

View File

@ -59,12 +59,12 @@ class GroovyTemplateAutoConfigurationTests {
private AnnotationConfigServletWebApplicationContext context = new AnnotationConfigServletWebApplicationContext();
@BeforeEach
public void setupContext() {
void setupContext() {
this.context.setServletContext(new MockServletContext());
}
@AfterEach
public void close() {
void close() {
LocaleContextHolder.resetLocaleContext();
if (this.context != null) {
this.context.close();

View File

@ -51,12 +51,12 @@ class H2ConsoleAutoConfigurationTests {
private AnnotationConfigServletWebApplicationContext context = new AnnotationConfigServletWebApplicationContext();
@BeforeEach
public void setupContext() {
void setupContext() {
this.context.setServletContext(new MockServletContext());
}
@AfterEach
public void close() {
void close() {
if (this.context != null) {
this.context.close();
}

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