diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ManagementEndpointPathResolverTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ManagementEndpointPathResolverTests.java index 3d8213c039c..2e9d497a7ab 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ManagementEndpointPathResolverTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ManagementEndpointPathResolverTests.java @@ -17,9 +17,7 @@ package org.springframework.boot.actuate.autoconfigure.endpoint; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.boot.actuate.autoconfigure.web.ManagementServerProperties; @@ -34,9 +32,6 @@ public class ManagementEndpointPathResolverTests { private ManagementEndpointPathResolver resolver; - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Before public void setUp() throws Exception { ManagementServerProperties properties = new ManagementServerProperties(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index 6ebd701d79a..e80c26a434e 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -44,9 +44,7 @@ import org.ehcache.jsr107.EhcacheCachingProvider; import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.jcache.embedded.JCachingProvider; import org.infinispan.spring.provider.SpringEmbeddedCacheManager; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.springframework.beans.DirectFieldAccessor; @@ -97,9 +95,6 @@ import static org.mockito.Mockito.verify; @ClassPathExclusions("hazelcast-client-*.jar") public class CacheAutoConfigurationTests { - @Rule - public final ExpectedException thrown = ExpectedException.none(); - private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(CacheAutoConfiguration.class)); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfigurationTests.java index aed46d1dd86..b1d26dd21c6 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfigurationTests.java @@ -22,9 +22,7 @@ import com.couchbase.client.java.CouchbaseBucket; import com.couchbase.client.java.cluster.ClusterInfo; import com.couchbase.client.java.env.CouchbaseEnvironment; import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration.CouchbaseConfiguration; import org.springframework.boot.autoconfigure.data.couchbase.CouchbaseDataAutoConfiguration; @@ -35,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; /** - * Tests for {@link CouchbaseAutoConfiguration} + * Tests for {@link CouchbaseAutoConfiguration}. * * @author EddĂș MelĂ©ndez * @author Stephane Nicoll @@ -43,9 +41,6 @@ import static org.mockito.Mockito.mock; public class CouchbaseAutoConfigurationTests extends AbstractCouchbaseAutoConfigurationTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void bootstrapHostsIsRequired() { load(null); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java index 6b9078875ed..940878865c3 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java @@ -22,9 +22,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.cluster.node.DiscoveryNode; import org.junit.After; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; @@ -43,9 +41,6 @@ import static org.mockito.Mockito.mock; */ public class ElasticsearchAutoConfigurationTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - private AnnotationConfigApplicationContext context; @After diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java index b03474e5c72..89484ff6c52 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java @@ -22,9 +22,7 @@ import java.util.Set; import com.mongodb.Mongo; import org.junit.After; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.beans.factory.BeanCreationException; import org.springframework.boot.autoconfigure.AutoConfigurationPackages; @@ -60,9 +58,6 @@ import static org.junit.Assert.fail; */ public class MongoDataAutoConfigurationTests { - @Rule - public final ExpectedException thrown = ExpectedException.none(); - private AnnotationConfigApplicationContext context; @After diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersTests.java index f5b8412b33c..a8a78cc199b 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersTests.java @@ -21,9 +21,7 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.http.converter.ByteArrayHttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter; @@ -48,9 +46,6 @@ import static org.mockito.Mockito.mock; */ public class HttpMessageConvertersTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void containsDefaults() throws Exception { HttpMessageConverters converters = new HttpMessageConverters(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java index 0be6348e35f..13e2cbc1302 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java @@ -17,9 +17,7 @@ package org.springframework.boot.autoconfigure.jmx; import org.junit.After; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.NoSuchBeanDefinitionException; @@ -41,15 +39,12 @@ import org.springframework.test.util.ReflectionTestUtils; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link JmxAutoConfiguration} + * Tests for {@link JmxAutoConfiguration}. * * @author Christian Dupuis */ public class JmxAutoConfigurationTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - private AnnotationConfigApplicationContext context; @After diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java index c349e248acf..b5bd3412656 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java @@ -18,9 +18,7 @@ package org.springframework.boot.autoconfigure.mongo; import com.mongodb.MongoClient; import com.mongodb.MongoClientOptions; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.util.TestPropertyValues; @@ -39,9 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class MongoPropertiesTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void canBindCharArrayPassword() { // gh-1572 diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java index a5be1c74193..8d79345bae7 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java @@ -22,9 +22,7 @@ import java.util.List; import javax.validation.ValidatorFactory; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.beans.DirectFieldAccessor; import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration; @@ -74,9 +72,6 @@ import static org.mockito.Mockito.verify; */ public class WebFluxAutoConfigurationTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - private GenericReactiveWebApplicationContext context; @Test diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java index 19ddae45937..4d65282a82f 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java @@ -21,9 +21,7 @@ import java.net.URI; import javax.servlet.MultipartConfigElement; import org.junit.After; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -67,9 +65,6 @@ public class MultipartAutoConfigurationTests { private AnnotationConfigServletWebServerApplicationContext context; - @Rule - public ExpectedException thrown = ExpectedException.none(); - @After public void close() { if (this.context != null) { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java index 07eeef3d78f..6225efc4644 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java @@ -18,9 +18,7 @@ package org.springframework.boot.autoconfigure.webservices; import java.util.Collection; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.beans.factory.BeanCreationException; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -43,9 +41,6 @@ public class WebServicesAutoConfigurationTests { private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() .withConfiguration(AutoConfigurations.of(WebServicesAutoConfiguration.class)); - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void defaultConfiguration() { this.contextRunner.run((context) -> assertThat(context) diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfigurationTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfigurationTests.java index aac591ce6a7..1492423a031 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfigurationTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfigurationTests.java @@ -29,9 +29,7 @@ import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -49,9 +47,6 @@ import static org.mockito.BDDMockito.given; */ public class SettingsXmlRepositorySystemSessionAutoConfigurationTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Mock private RepositorySystem repositorySystem; diff --git a/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTestReactiveIntegrationTests.java b/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTestReactiveIntegrationTests.java index 29b9076b711..29f15663f63 100644 --- a/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTestReactiveIntegrationTests.java +++ b/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTestReactiveIntegrationTests.java @@ -16,9 +16,7 @@ package org.springframework.boot.test.autoconfigure.data.mongo; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -36,9 +34,6 @@ import static org.assertj.core.api.Assertions.assertThat; @DataMongoTest public class DataMongoTestReactiveIntegrationTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Autowired private ReactiveMongoTemplate mongoTemplate; diff --git a/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessorTests.java b/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessorTests.java index 55e491ebbc3..d0965ab7c47 100644 --- a/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessorTests.java +++ b/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessorTests.java @@ -24,7 +24,6 @@ import java.util.Properties; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.springframework.boot.testsupport.compiler.TestCompiler; @@ -41,9 +40,6 @@ public class AutoConfigureAnnotationProcessorTests { @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); - @Rule - public ExpectedException thrown = ExpectedException.none(); - private TestCompiler compiler; @Before diff --git a/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarURLConnectionTests.java b/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarURLConnectionTests.java index ea73baf41ea..aec69d11ebb 100644 --- a/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarURLConnectionTests.java +++ b/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarURLConnectionTests.java @@ -23,7 +23,6 @@ import java.net.URL; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.springframework.boot.loader.TestJarCreator; @@ -42,9 +41,6 @@ public class JarURLConnectionTests { @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(new File("target")); - @Rule - public ExpectedException thrown = ExpectedException.none(); - private File rootJarFile; private JarFile jarFile; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/config/DelegatingApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/config/DelegatingApplicationListenerTests.java index a6d6bd1996b..d91c7aa29df 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/config/DelegatingApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/config/DelegatingApplicationListenerTests.java @@ -17,9 +17,7 @@ package org.springframework.boot.context.config; import org.junit.After; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.boot.SpringApplication; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; @@ -40,9 +38,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class DelegatingApplicationListenerTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - private final DelegatingApplicationListener listener = new DelegatingApplicationListener(); private final StaticApplicationContext context = new StaticApplicationContext(); diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/convert/InetAddressToStringConverterTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/convert/InetAddressToStringConverterTests.java index 4e3402254a8..3455ea3a709 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/convert/InetAddressToStringConverterTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/convert/InetAddressToStringConverterTests.java @@ -18,9 +18,7 @@ package org.springframework.boot.context.properties.bind.convert; import java.net.InetAddress; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import static org.assertj.core.api.Assertions.assertThat; @@ -31,9 +29,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class InetAddressToStringConverterTests extends AbstractInetAddressTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - private InetAddressToStringConverter converter = new InetAddressToStringConverter(); @Test diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandlerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandlerTests.java index 60832690e89..ac59da56add 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandlerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandlerTests.java @@ -19,9 +19,7 @@ package org.springframework.boot.context.properties.bind.handler; import java.util.ArrayList; import java.util.List; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.boot.context.properties.bind.BindException; import org.springframework.boot.context.properties.bind.BindHandler; @@ -42,9 +40,6 @@ import static org.assertj.core.api.Assertions.fail; */ public class NoUnboundElementsBindHandlerTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - private List sources = new ArrayList<>(); private Binder binder; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/test/PackagePrivateBeanBindingTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/test/PackagePrivateBeanBindingTests.java index 70a4c830e00..24c5daf8f68 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/test/PackagePrivateBeanBindingTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/test/PackagePrivateBeanBindingTests.java @@ -20,9 +20,7 @@ import java.util.ArrayList; import java.util.List; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; @@ -39,9 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class PackagePrivateBeanBindingTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - private List sources = new ArrayList<>(); private Binder binder; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java index 1a7236f0544..1f962bf0b65 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java @@ -20,9 +20,7 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.Environment; @@ -43,9 +41,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class ConfigurationPropertySourcesTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void attachShouldAddAdapterAtBeginning() throws Exception { ConfigurableEnvironment environment = new StandardEnvironment(); diff --git a/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java b/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java index 7955dd9f0c4..cc60cf85e19 100644 --- a/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java @@ -21,9 +21,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import static org.assertj.core.api.Assertions.assertThat; @@ -34,9 +32,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class MimeMappingsTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test(expected = UnsupportedOperationException.class) public void defaultsCannotBeModified() throws Exception { MimeMappings.DEFAULT.add("foo", "foo/bar");