Remove unused ExpectedExceptions
Closes gh-10101
This commit is contained in:
committed by
Stephane Nicoll
parent
3ef3b40783
commit
118f65556f
@@ -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));
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user