Move back to JUnit 4 until SUREFIRE-1614 has been resolved

See gh-14736
See gh-14737
See gh-14738
This commit is contained in:
Andy Wilkinson
2018-12-12 12:23:20 +00:00
parent 2b453bbb16
commit 064f6478df
806 changed files with 2221 additions and 2220 deletions

View File

@@ -20,8 +20,8 @@ import java.util.Collections;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -49,7 +49,7 @@ public class RabbitHealthIndicatorTests {
@Mock
private Channel channel;
@BeforeEach
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
given(this.rabbitTemplate.execute(any())).willAnswer((invocation) -> {

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.actuate.audit;
import java.util.Collections;
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;

View File

@@ -20,7 +20,7 @@ import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;

View File

@@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.audit.listener;
import java.util.Collections;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.AuditEventRepository;

View File

@@ -21,7 +21,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;

View File

@@ -22,7 +22,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.cache.CachesEndpoint.CacheEntry;
import org.springframework.boot.actuate.cache.CachesEndpoint.CacheManagerDescriptor;

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.cassandra;
import com.datastax.driver.core.querybuilder.Select;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.context.properties;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesBeanDescriptor;

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.context.properties;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.context.properties;
import javax.sql.DataSource;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesBeanDescriptor;

View File

@@ -23,7 +23,7 @@ import java.util.List;
import java.util.Map;
import com.zaxxer.hikari.HikariDataSource;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesBeanDescriptor;

View File

@@ -24,7 +24,7 @@ import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesBeanDescriptor;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ContextConfigurationProperties;

View File

@@ -26,7 +26,7 @@ import com.couchbase.client.core.message.internal.EndpointHealth;
import com.couchbase.client.core.service.ServiceType;
import com.couchbase.client.core.state.LifecycleState;
import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;

View File

@@ -25,7 +25,7 @@ import com.couchbase.client.core.message.internal.EndpointHealth;
import com.couchbase.client.core.service.ServiceType;
import com.couchbase.client.core.state.LifecycleState;
import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;

View File

@@ -31,8 +31,8 @@ import org.elasticsearch.cluster.block.ClusterBlocks;
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.routing.RoutingTable;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -62,7 +62,7 @@ public class ElasticsearchHealthIndicatorTests {
private ElasticsearchHealthIndicator indicator;
@BeforeEach
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
given(this.client.admin()).willReturn(this.admin);

View File

@@ -26,7 +26,7 @@ import io.searchbox.client.JestClient;
import io.searchbox.client.JestResult;
import io.searchbox.client.config.exception.CouldNotConnectException;
import io.searchbox.core.SearchResult;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;

View File

@@ -25,7 +25,7 @@ import org.apache.http.entity.BasicHttpEntity;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.RestClient;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;

View File

@@ -16,10 +16,10 @@
package org.springframework.boot.actuate.endpoint;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.test.extension.OutputCapture;
import org.springframework.boot.testsupport.rule.OutputCapture;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
@@ -31,8 +31,8 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
*/
public class EndpointIdTests {
@RegisterExtension
public OutputCapture output = new OutputCapture();
@Rule
public final OutputCapture output = new OutputCapture();
@Test
public void ofWhenNullThrowsException() {

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.endpoint;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.annotation;
import java.lang.reflect.Method;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.OperationType;
import org.springframework.core.annotation.AnnotationAttributes;

View File

@@ -22,8 +22,8 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.InvocationContext;
@@ -51,7 +51,7 @@ public class DiscoveredOperationsFactoryTests {
private List<OperationInvokerAdvisor> invokerAdvisors;
@BeforeEach
@Before
public void setup() {
this.parameterValueMapper = (parameter, value) -> value.toString();
this.invokerAdvisors = new ArrayList<>();

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.annotation;
import java.util.Collection;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointFilter;
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;

View File

@@ -32,7 +32,7 @@ import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointFilter;
import org.springframework.boot.actuate.endpoint.EndpointId;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.invoke.convert;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.invoke.OperationParameter;
import org.springframework.boot.actuate.endpoint.invoke.ParameterMappingException;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.invoke.convert;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.core.convert.support.DefaultConversionService;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.invoke.reflect;
import java.lang.reflect.Method;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.lang.Nullable;
import org.springframework.util.ReflectionUtils;

View File

@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.invoke.OperationParameter;
import org.springframework.core.DefaultParameterNameDiscoverer;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.invoke.reflect;
import java.lang.reflect.Method;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.OperationType;
import org.springframework.boot.actuate.endpoint.invoke.OperationParameters;

View File

@@ -18,8 +18,8 @@ package org.springframework.boot.actuate.endpoint.invoke.reflect;
import java.util.Collections;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.InvocationContext;
import org.springframework.boot.actuate.endpoint.OperationType;
@@ -47,7 +47,7 @@ public class ReflectiveOperationInvokerTests {
private ParameterValueMapper parameterValueMapper;
@BeforeEach
@Before
public void setup() {
this.target = new Example();
this.operationMethod = new OperationMethod(

View File

@@ -19,8 +19,8 @@ package org.springframework.boot.actuate.endpoint.invoker.cache;
import java.lang.reflect.Method;
import java.util.function.Function;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -54,7 +54,7 @@ public class CachingOperationInvokerAdvisorTests {
private CachingOperationInvokerAdvisor advisor;
@BeforeEach
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.advisor = new CachingOperationInvokerAdvisor(this.timeToLive);

View File

@@ -21,7 +21,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.InvocationContext;
import org.springframework.boot.actuate.endpoint.SecurityContext;

View File

@@ -27,7 +27,7 @@ import javax.management.MBeanException;
import javax.management.MBeanInfo;
import javax.management.ReflectionException;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import reactor.core.publisher.Mono;
import org.springframework.beans.FatalBeanException;

View File

@@ -25,7 +25,7 @@ import java.util.Set;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.test.json.BasicJsonTester;

View File

@@ -25,8 +25,8 @@ import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
@@ -71,7 +71,7 @@ public class JmxEndpointExporterTests {
private JmxEndpointExporter exporter;
@BeforeEach
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.exporter = new JmxEndpointExporter(this.mBeanServer, this.objectNameFactory,

View File

@@ -23,7 +23,7 @@ import javax.management.MBeanInfo;
import javax.management.MBeanOperationInfo;
import javax.management.MBeanParameterInfo;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.OperationType;

View File

@@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.OperationType;

View File

@@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Function;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.annotation.DeleteOperation;

View File

@@ -22,7 +22,7 @@ import java.util.List;
import java.util.Map;
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.OperationType;

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.endpoint.web;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -20,7 +20,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -27,7 +27,7 @@ import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.endpoint.web;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.EndpointsSupplier;

View File

@@ -26,8 +26,8 @@ import javax.servlet.ServletRegistration.Dynamic;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
@@ -60,7 +60,7 @@ public class ServletEndpointRegistrarTests {
@Captor
private ArgumentCaptor<Servlet> servlet;
@BeforeEach
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
given(this.servletContext.addServlet(any(String.class), any(Servlet.class)))

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.endpoint.web;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.web;
import java.util.Collections;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -27,7 +27,7 @@ import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Supplier;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import reactor.core.publisher.Mono;
import org.springframework.boot.actuate.endpoint.SecurityContext;

View File

@@ -22,7 +22,7 @@ import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;

View File

@@ -29,7 +29,7 @@ import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;

View File

@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.annotation.DeleteOperation;

View File

@@ -22,7 +22,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.web.EndpointMapping;
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointDiscoverer;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.web.reactive;
import java.util.Arrays;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.EndpointMapping;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.web.reactive;
import java.util.Arrays;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import reactor.core.publisher.Mono;
import org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver;

View File

@@ -22,7 +22,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.web.EndpointMapping;
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointDiscoverer;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.endpoint.web.servlet;
import java.util.Arrays;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.EndpointMapping;

View File

@@ -25,7 +25,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver;
import org.springframework.boot.actuate.endpoint.web.EndpointMapping;

View File

@@ -17,7 +17,7 @@
package org.springframework.boot.actuate.endpoint.web.servlet;
import io.micrometer.core.instrument.Tag;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.metrics.web.servlet.WebMvcTags;
import org.springframework.mock.web.MockHttpServletRequest;

View File

@@ -20,8 +20,8 @@ import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.After;
import org.junit.Test;
import org.springframework.boot.actuate.env.EnvironmentEndpoint.EnvironmentDescriptor;
import org.springframework.boot.actuate.env.EnvironmentEndpoint.EnvironmentEntryDescriptor;
@@ -52,7 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
public class EnvironmentEndpointTests {
@AfterEach
@After
public void close() {
System.clearProperty("VCAP_SERVICES");
}

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.flyway;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.flyway.FlywayEndpoint.FlywayDescriptor;
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.health;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.actuate.health;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -21,8 +21,8 @@ import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -46,7 +46,7 @@ public class CompositeHealthIndicatorTests {
@Mock
private HealthIndicator two;
@BeforeEach
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
given(this.one.health())

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.actuate.health;
import java.util.Collections;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

View File

@@ -21,7 +21,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

View File

@@ -18,8 +18,8 @@ package org.springframework.boot.actuate.health;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
@@ -41,7 +41,7 @@ public class DefaultHealthIndicatorRegistryTests {
private DefaultHealthIndicatorRegistry registry;
@BeforeEach
@Before
public void setUp() {
given(this.one.health())
.willReturn(new Health.Builder().unknown().withDetail("1", "1").build());

View File

@@ -18,8 +18,8 @@ package org.springframework.boot.actuate.health;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import reactor.core.publisher.Mono;
import static org.assertj.core.api.Assertions.assertThat;
@@ -42,7 +42,7 @@ public class DefaultReactiveHealthIndicatorRegistryTests {
private DefaultReactiveHealthIndicatorRegistry registry;
@BeforeEach
@Before
public void setUp() {
given(this.one.health()).willReturn(
Mono.just(new Health.Builder().unknown().withDetail("1", "1").build()));

View File

@@ -20,7 +20,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.health;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import reactor.test.StepVerifier;
import static org.mockito.BDDMockito.given;

View File

@@ -20,7 +20,7 @@ import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -23,7 +23,7 @@ import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.mockito.stubbing.Answer;
import org.springframework.boot.actuate.endpoint.SecurityContext;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,8 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
@@ -34,7 +34,7 @@ public class OrderedHealthAggregatorTests {
private OrderedHealthAggregator healthAggregator;
@BeforeEach
@Before
public void setup() {
this.healthAggregator = new OrderedHealthAggregator();
}

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.health;
import java.util.Collections;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import java.io.IOException;
import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBException;
import org.influxdb.dto.Pong;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.info;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.boot.test.util.TestPropertyValues.Type;

View File

@@ -20,7 +20,7 @@ import java.time.Instant;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.info.InfoPropertiesInfoContributor.Mode;
import org.springframework.boot.info.GitProperties;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.info;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

View File

@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.info;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -16,8 +16,8 @@
package org.springframework.boot.actuate.integration;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -43,7 +43,7 @@ public class IntegrationGraphEndpointTests {
@InjectMocks
private IntegrationGraphEndpoint integrationGraphEndpoint;
@BeforeEach
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
}

View File

@@ -20,9 +20,9 @@ import java.sql.Connection;
import javax.sql.DataSource;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
@@ -50,7 +50,7 @@ public class DataSourceHealthIndicatorTests {
private SingleConnectionDataSource dataSource;
@BeforeEach
@Before
public void init() {
EmbeddedDatabaseConnection db = EmbeddedDatabaseConnection.HSQL;
this.dataSource = new SingleConnectionDataSource(
@@ -58,7 +58,7 @@ public class DataSourceHealthIndicatorTests {
this.dataSource.setDriverClassName(db.getDriverClassName());
}
@AfterEach
@After
public void close() {
if (this.dataSource != null) {
this.dataSource.destroy();

View File

@@ -21,7 +21,7 @@ import javax.jms.ConnectionFactory;
import javax.jms.ConnectionMetaData;
import javax.jms.JMSException;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.ldap;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;

View File

@@ -21,7 +21,7 @@ import java.sql.SQLException;
import javax.sql.DataSource;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

View File

@@ -19,13 +19,11 @@ package org.springframework.boot.actuate.logging;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.support.io.TempDirectory;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.springframework.core.io.Resource;
import org.springframework.mock.env.MockEnvironment;
@@ -41,18 +39,20 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Phillip Webb
* @author Andy Wilkinson
*/
@ExtendWith(TempDirectory.class)
public class LogFileWebEndpointTests {
private final MockEnvironment environment = new MockEnvironment();
private final LogFileWebEndpoint endpoint = new LogFileWebEndpoint(this.environment);
@Rule
public final TemporaryFolder temp = new TemporaryFolder();
private File logFile;
@BeforeEach
public void before(@TempDirectory.TempDir Path temp) throws IOException {
this.logFile = Files.createTempFile(temp, "junit", null).toFile();
@Before
public void before() throws IOException {
this.logFile = this.temp.newFile();
FileCopyUtils.copy("--TEST--".getBytes(), this.logFile);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.logging.LoggersEndpoint.LoggerLevels;
import org.springframework.boot.logging.LogLevel;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,8 +27,8 @@ import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.URLName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
@@ -51,7 +51,7 @@ public class MailHealthIndicatorTests {
private MailHealthIndicator indicator;
@BeforeEach
@Before
public void setup() {
Session session = Session.getDefaultInstance(new Properties());
session.addProvider(new Provider(Type.TRANSPORT, "success",

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.management;
import java.util.concurrent.CountDownLatch;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package org.springframework.boot.actuate.management;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -27,7 +27,7 @@ import io.micrometer.core.instrument.Statistic;
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
import io.micrometer.core.instrument.simple.SimpleConfig;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.actuate.endpoint.InvalidEndpointRequestException;

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.actuate.metrics.amqp;
import com.rabbitmq.client.ConnectionFactory;
import io.micrometer.core.instrument.Tags;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

View File

@@ -21,7 +21,7 @@ import java.util.Collections;
import com.github.benmanes.caffeine.cache.Caffeine;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.cache.caffeine.CaffeineCache;
import org.springframework.cache.transaction.TransactionAwareCacheDecorator;

View File

@@ -21,7 +21,7 @@ import java.util.Collections;
import com.github.benmanes.caffeine.cache.Caffeine;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.CaffeineCacheMetrics;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.cache.caffeine.CaffeineCache;

View File

@@ -24,7 +24,7 @@ import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.config.CacheConfiguration;
import net.sf.ehcache.config.Configuration;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.cache.ehcache.EhCacheCache;

View File

@@ -22,7 +22,7 @@ import com.hazelcast.core.IMap;
import com.hazelcast.spring.cache.HazelcastCache;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.HazelcastCacheMetrics;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;

View File

@@ -22,10 +22,10 @@ import java.util.Collections;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.JCacheMetrics;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.cache.jcache.JCacheCache;
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.mock;
*
* @author Stephane Nicoll
*/
@ExtendWith(MockitoExtension.class)
@RunWith(MockitoJUnitRunner.class)
public class JCacheCacheMeterBinderProviderTests {
@Mock

View File

@@ -24,8 +24,8 @@ import java.util.concurrent.ScheduledFuture;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.exporter.PushGateway;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
@@ -71,7 +71,7 @@ public class PrometheusPushGatewayManagerTests {
@Mock
private ScheduledFuture<Object> future;
@BeforeEach
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.scheduler = mockScheduler(TaskScheduler.class);

View File

@@ -23,7 +23,7 @@ import javax.sql.DataSource;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

View File

@@ -25,8 +25,8 @@ import io.micrometer.core.instrument.MockClock;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.simple.SimpleConfig;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
@@ -53,7 +53,7 @@ public class MetricsRestTemplateCustomizerTests {
private MetricsRestTemplateCustomizer customizer;
@BeforeEach
@Before
public void setup() {
this.registry = new SimpleMeterRegistry(SimpleConfig.DEFAULT, new MockClock());
this.restTemplate = new RestTemplate();

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