Browse Source

Use assertThat from Hamcrest instead of JUnit 4

org.junit.Assert.assertThat() is deprecated as of JUnit 4.13.

See gh-22894
pull/22898/head
Sam Brannen 7 years ago
parent
commit
47c39304af
  1. 1
      spring-expression/src/test/java/org/springframework/expression/spel/EvaluationTests.java
  2. 1
      spring-expression/src/test/java/org/springframework/expression/spel/MapAccessTests.java
  3. 1
      spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java
  4. 1
      spring-jdbc/src/test/java/org/springframework/jdbc/config/JdbcNamespaceIntegrationTests.java
  5. 1
      spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java
  6. 1
      spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/BeanPropertySqlParameterSourceTests.java
  7. 2
      spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java
  8. 2
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTests.java
  9. 2
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/AbstractDatabaseInitializationTests.java
  10. 1
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/AbstractDatabasePopulatorTests.java
  11. 2
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/H2DatabasePopulatorTests.java
  12. 1
      spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java
  13. 1
      spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java
  14. 1
      spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLExceptionCustomTranslatorTests.java
  15. 1
      spring-messaging/src/test/java/org/springframework/messaging/converter/MappingJackson2MessageConverterTests.java
  16. 1
      spring-messaging/src/test/java/org/springframework/messaging/converter/MarshallingMessageConverterTests.java
  17. 1
      spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethodTests.java
  18. 1
      spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/MethodMessageHandlerTests.java
  19. 1
      spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/reactive/MethodMessageHandlerTests.java
  20. 2
      spring-messaging/src/test/java/org/springframework/messaging/simp/SimpAttributesTests.java
  21. 2
      spring-messaging/src/test/java/org/springframework/messaging/simp/SimpSessionScopeTests.java
  22. 1
      spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java
  23. 1
      spring-messaging/src/test/java/org/springframework/messaging/simp/config/MessageBrokerConfigurationTests.java
  24. 1
      spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/DefaultStompSessionTests.java
  25. 1
      spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/ReactorNettyTcpStompClientTests.java
  26. 1
      spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompHeaderAccessorTests.java
  27. 1
      spring-messaging/src/test/java/org/springframework/messaging/simp/user/MultiServerUserRegistryTests.java
  28. 2
      spring-messaging/src/test/java/org/springframework/messaging/support/ErrorMessageTests.java
  29. 1
      spring-messaging/src/test/java/org/springframework/messaging/support/ExecutorSubscribableChannelTests.java
  30. 2
      spring-messaging/src/test/java/org/springframework/messaging/support/MessageHeaderAccessorTests.java
  31. 1
      spring-orm/src/test/java/org/springframework/orm/jpa/SharedEntityManagerCreatorTests.java
  32. 2
      spring-orm/src/test/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManagerTests.java
  33. 2
      spring-oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTests.java
  34. 2
      spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java
  35. 1
      spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java
  36. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java
  37. 2
      spring-webflux/src/test/java/org/springframework/web/reactive/config/ResourceHandlerRegistryTests.java
  38. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/function/BodyInsertersTests.java
  39. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java
  40. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/resource/AppCacheManifestTransformerTests.java
  41. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceUrlProviderTests.java
  42. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java
  43. 2
      spring-webflux/src/test/java/org/springframework/web/reactive/resource/VersionResourceResolverTests.java
  44. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/result/method/HandlerMethodMappingTests.java
  45. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/result/method/InvocableHandlerMethodTests.java
  46. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/result/method/RequestMappingInfoHandlerMappingTests.java
  47. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/GlobalCorsConfigIntegrationTests.java
  48. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java
  49. 1
      spring-webflux/src/test/java/org/springframework/web/reactive/socket/server/support/HandshakeWebSocketServiceTests.java
  50. 2
      spring-websocket/src/test/java/org/springframework/web/socket/TextMessageTests.java
  51. 1
      spring-websocket/src/test/java/org/springframework/web/socket/WebSocketExtensionTests.java
  52. 2
      spring-websocket/src/test/java/org/springframework/web/socket/adapter/standard/ConvertingEncoderDecoderSupportTests.java
  53. 1
      spring-websocket/src/test/java/org/springframework/web/socket/config/HandlersBeanDefinitionParserTests.java
  54. 1
      spring-websocket/src/test/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParserTests.java
  55. 2
      spring-websocket/src/test/java/org/springframework/web/socket/handler/WebSocketHttpHeadersTests.java
  56. 1
      spring-websocket/src/test/java/org/springframework/web/socket/messaging/StompSubProtocolHandlerTests.java
  57. 7
      spring-websocket/src/test/java/org/springframework/web/socket/messaging/WebSocketStompClientIntegrationTests.java
  58. 1
      spring-websocket/src/test/java/org/springframework/web/socket/sockjs/client/ClientSockJsSessionTests.java
  59. 5
      spring-websocket/src/test/java/org/springframework/web/socket/sockjs/client/SockJsUrlInfoTests.java

1
spring-expression/src/test/java/org/springframework/expression/spel/EvaluationTests.java

@ -42,6 +42,7 @@ import org.springframework.expression.spel.support.StandardEvaluationContext; @@ -42,6 +42,7 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.expression.spel.support.StandardTypeLocator;
import org.springframework.expression.spel.testresources.TestPerson;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-expression/src/test/java/org/springframework/expression/spel/MapAccessTests.java

@ -33,6 +33,7 @@ import org.springframework.tests.Assume; @@ -33,6 +33,7 @@ import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.util.StopWatch;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java

@ -62,6 +62,7 @@ import org.springframework.expression.spel.support.StandardTypeLocator; @@ -62,6 +62,7 @@ import org.springframework.expression.spel.support.StandardTypeLocator;
import org.springframework.expression.spel.testresources.le.div.mod.reserved.Reserver;
import org.springframework.util.ObjectUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-jdbc/src/test/java/org/springframework/jdbc/config/JdbcNamespaceIntegrationTests.java

@ -40,6 +40,7 @@ import org.springframework.tests.Assume; @@ -40,6 +40,7 @@ import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory.*;

1
spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java

@ -54,6 +54,7 @@ import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator; @@ -54,6 +54,7 @@ import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
import org.springframework.util.LinkedCaseInsensitiveMap;
import org.springframework.util.StringUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

1
spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/BeanPropertySqlParameterSourceTests.java

@ -24,6 +24,7 @@ import org.junit.Test; @@ -24,6 +24,7 @@ import org.junit.Test;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.jdbc.core.support;
import java.io.ByteArrayInputStream;
@ -33,6 +34,7 @@ import org.mockito.MockitoAnnotations; @@ -33,6 +34,7 @@ import org.mockito.MockitoAnnotations;
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobHandler;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

2
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTests.java

@ -23,8 +23,8 @@ import javax.sql.DataSource; @@ -23,8 +23,8 @@ import javax.sql.DataSource;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**

2
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/AbstractDatabaseInitializationTests.java

@ -27,8 +27,8 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @@ -27,8 +27,8 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Abstract base class for integration tests involving database initialization.

1
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/AbstractDatabasePopulatorTests.java

@ -25,6 +25,7 @@ import org.springframework.jdbc.datasource.DataSourceUtils; @@ -25,6 +25,7 @@ import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

2
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/H2DatabasePopulatorTests.java

@ -19,8 +19,8 @@ package org.springframework.jdbc.datasource.init; @@ -19,8 +19,8 @@ package org.springframework.jdbc.datasource.init;
import org.junit.Test;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* @author Sam Brannen

1
spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java

@ -41,6 +41,7 @@ import org.springframework.jdbc.core.SqlParameter; @@ -41,6 +41,7 @@ import org.springframework.jdbc.core.SqlParameter;
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

1
spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java

@ -28,6 +28,7 @@ import org.springframework.core.io.ClassPathResource; @@ -28,6 +28,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

1
spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLExceptionCustomTranslatorTests.java

@ -25,6 +25,7 @@ import org.springframework.dao.TransientDataAccessResourceException; @@ -25,6 +25,7 @@ import org.springframework.dao.TransientDataAccessResourceException;
import org.springframework.jdbc.BadSqlGrammarException;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-messaging/src/test/java/org/springframework/messaging/converter/MappingJackson2MessageConverterTests.java

@ -33,6 +33,7 @@ import org.springframework.messaging.MessageHeaders; @@ -33,6 +33,7 @@ import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.util.MimeType;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-messaging/src/test/java/org/springframework/messaging/converter/MarshallingMessageConverterTests.java

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
package org.springframework.messaging.converter;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.xmlunit.diff.ComparisonType.*;
import static org.xmlunit.diff.DifferenceEvaluators.*;

1
spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethodTests.java

@ -24,6 +24,7 @@ import org.springframework.core.MethodParameter; @@ -24,6 +24,7 @@ import org.springframework.core.MethodParameter;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

1
spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/MethodMessageHandlerTests.java

@ -41,6 +41,7 @@ import org.springframework.util.AntPathMatcher; @@ -41,6 +41,7 @@ import org.springframework.util.AntPathMatcher;
import org.springframework.util.Assert;
import org.springframework.util.PathMatcher;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/reactive/MethodMessageHandlerTests.java

@ -45,6 +45,7 @@ import org.springframework.util.Assert; @@ -45,6 +45,7 @@ import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.PathMatcher;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-messaging/src/test/java/org/springframework/messaging/simp/SimpAttributesTests.java

@ -25,8 +25,8 @@ import org.junit.Test; @@ -25,8 +25,8 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mockito;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
/**

2
spring-messaging/src/test/java/org/springframework/messaging/simp/SimpSessionScopeTests.java

@ -25,8 +25,8 @@ import org.mockito.Mockito; @@ -25,8 +25,8 @@ import org.mockito.Mockito;
import org.springframework.beans.factory.ObjectFactory;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**

1
spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java

@ -67,6 +67,7 @@ import org.springframework.validation.Errors; @@ -67,6 +67,7 @@ import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
import org.springframework.validation.annotation.Validated;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.any;

1
spring-messaging/src/test/java/org/springframework/messaging/simp/config/MessageBrokerConfigurationTests.java

@ -77,6 +77,7 @@ import org.springframework.validation.Errors; @@ -77,6 +77,7 @@ import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

1
spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/DefaultStompSessionTests.java

@ -46,6 +46,7 @@ import org.springframework.util.MimeType; @@ -46,6 +46,7 @@ import org.springframework.util.MimeType;
import org.springframework.util.MimeTypeUtils;
import org.springframework.util.concurrent.SettableListenableFuture;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.any;

1
spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/ReactorNettyTcpStompClientTests.java

@ -40,6 +40,7 @@ import org.springframework.util.Assert; @@ -40,6 +40,7 @@ import org.springframework.util.Assert;
import org.springframework.util.SocketUtils;
import org.springframework.util.concurrent.ListenableFuture;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompHeaderAccessorTests.java

@ -37,6 +37,7 @@ import org.springframework.util.MimeType; @@ -37,6 +37,7 @@ import org.springframework.util.MimeType;
import org.springframework.util.MimeTypeUtils;
import org.springframework.util.MultiValueMap;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-messaging/src/test/java/org/springframework/messaging/simp/user/MultiServerUserRegistryTests.java

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
package org.springframework.messaging.simp.user;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

2
spring-messaging/src/test/java/org/springframework/messaging/support/ErrorMessageTests.java

@ -19,7 +19,7 @@ package org.springframework.messaging.support; @@ -19,7 +19,7 @@ package org.springframework.messaging.support;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author Gary Russell

1
spring-messaging/src/test/java/org/springframework/messaging/support/ExecutorSubscribableChannelTests.java

@ -33,6 +33,7 @@ import org.springframework.messaging.MessageChannel; @@ -33,6 +33,7 @@ import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageDeliveryException;
import org.springframework.messaging.MessageHandler;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

2
spring-messaging/src/test/java/org/springframework/messaging/support/MessageHeaderAccessorTests.java

@ -32,13 +32,13 @@ import org.springframework.util.MimeTypeUtils; @@ -32,13 +32,13 @@ import org.springframework.util.MimeTypeUtils;
import org.springframework.util.SerializationTestUtils;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
/**

1
spring-orm/src/test/java/org/springframework/orm/jpa/SharedEntityManagerCreatorTests.java

@ -28,6 +28,7 @@ import org.junit.runner.RunWith; @@ -28,6 +28,7 @@ import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.mockito.BDDMockito.verifyNoMoreInteractions;

2
spring-orm/src/test/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManagerTests.java

@ -23,8 +23,8 @@ import org.springframework.core.io.ClassPathResource; @@ -23,8 +23,8 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.orm.jpa.domain.Person;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Tests for {@link DefaultPersistenceUnitManager}.

2
spring-oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTests.java

@ -37,7 +37,7 @@ import javax.xml.transform.stream.StreamResult; @@ -37,7 +37,7 @@ import javax.xml.transform.stream.StreamResult;
import java.io.ByteArrayOutputStream;
import java.io.StringWriter;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
/**

2
spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java

@ -54,9 +54,9 @@ import java.lang.reflect.Method; @@ -54,9 +54,9 @@ import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Collections;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.eq;

1
spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java

@ -58,6 +58,7 @@ import org.xmlunit.xpath.JAXPXPathEngine; @@ -58,6 +58,7 @@ import org.xmlunit.xpath.JAXPXPathEngine;
import org.springframework.util.xml.StaxUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.xmlunit.matchers.CompareMatcher.*;

1
spring-webflux/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java

@ -52,6 +52,7 @@ import org.springframework.web.server.handler.ExceptionHandlingWebHandler; @@ -52,6 +52,7 @@ import org.springframework.web.server.handler.ExceptionHandlingWebHandler;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.*;
import static org.springframework.http.MediaType.*;

2
spring-webflux/src/test/java/org/springframework/web/reactive/config/ResourceHandlerRegistryTests.java

@ -49,10 +49,10 @@ import org.springframework.web.reactive.resource.ResourceWebHandler; @@ -49,10 +49,10 @@ import org.springframework.web.reactive.resource.ResourceWebHandler;
import org.springframework.web.reactive.resource.VersionResourceResolver;
import org.springframework.web.reactive.resource.WebJarsResourceResolver;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
/**

1
spring-webflux/src/test/java/org/springframework/web/reactive/function/BodyInsertersTests.java

@ -68,6 +68,7 @@ import org.springframework.util.LinkedMultiValueMap; @@ -68,6 +68,7 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import static java.nio.charset.StandardCharsets.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.http.codec.json.Jackson2CodecSupport.*;

1
spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java

@ -56,6 +56,7 @@ import org.springframework.http.client.reactive.JettyClientHttpConnector; @@ -56,6 +56,7 @@ import org.springframework.http.client.reactive.JettyClientHttpConnector;
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
import org.springframework.http.codec.Pojo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-webflux/src/test/java/org/springframework/web/reactive/resource/AppCacheManifestTransformerTests.java

@ -29,6 +29,7 @@ import org.springframework.core.io.Resource; @@ -29,6 +29,7 @@ import org.springframework.core.io.Resource;
import org.springframework.mock.web.test.server.MockServerWebExchange;
import org.springframework.util.FileCopyUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.mock.http.server.reactive.test.MockServerHttpRequest.*;

1
spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceUrlProviderTests.java

@ -39,6 +39,7 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon @@ -39,6 +39,7 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon
import org.springframework.web.reactive.handler.SimpleUrlHandlerMapping;
import org.springframework.web.util.pattern.PathPattern;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.springframework.mock.http.server.reactive.test.MockServerHttpRequest.*;

1
spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java

@ -55,6 +55,7 @@ import org.springframework.web.server.MethodNotAllowedException; @@ -55,6 +55,7 @@ import org.springframework.web.server.MethodNotAllowedException;
import org.springframework.web.server.ResponseStatusException;
import org.springframework.web.server.ServerWebExchange;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;

2
spring-webflux/src/test/java/org/springframework/web/reactive/resource/VersionResourceResolverTests.java

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.reactive.resource;
import java.time.Duration;
@ -33,6 +34,7 @@ import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest; @@ -33,6 +34,7 @@ import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
import org.springframework.mock.web.test.server.MockServerWebExchange;
import org.springframework.web.server.ServerWebExchange;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

1
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/HandlerMethodMappingTests.java

@ -35,6 +35,7 @@ import org.springframework.web.server.ServerWebExchange; @@ -35,6 +35,7 @@ import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.util.pattern.PathPattern;
import org.springframework.web.util.pattern.PathPatternParser;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/InvocableHandlerMethodTests.java

@ -42,6 +42,7 @@ import org.springframework.web.reactive.HandlerResult; @@ -42,6 +42,7 @@ import org.springframework.web.reactive.HandlerResult;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.UnsupportedMediaTypeStatusException;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.any;

1
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/RequestMappingInfoHandlerMappingTests.java

@ -59,6 +59,7 @@ import org.springframework.web.server.UnsupportedMediaTypeStatusException; @@ -59,6 +59,7 @@ import org.springframework.web.server.UnsupportedMediaTypeStatusException;
import org.springframework.web.util.pattern.PathPattern;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.springframework.mock.http.server.reactive.test.MockServerHttpRequest.*;
import static org.springframework.web.bind.annotation.RequestMethod.*;

1
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/GlobalCorsConfigIntegrationTests.java

@ -36,6 +36,7 @@ import org.springframework.web.client.RestTemplate; @@ -36,6 +36,7 @@ import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.config.CorsRegistry;
import org.springframework.web.reactive.config.WebFluxConfigurationSupport;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java

@ -38,6 +38,7 @@ import org.springframework.http.HttpHeaders; @@ -38,6 +38,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.web.reactive.HandlerMapping;
import org.springframework.web.reactive.handler.SimpleUrlHandlerMapping;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-webflux/src/test/java/org/springframework/web/reactive/socket/server/support/HandshakeWebSocketServiceTests.java

@ -33,6 +33,7 @@ import org.springframework.web.reactive.socket.WebSocketHandler; @@ -33,6 +33,7 @@ import org.springframework.web.reactive.socket.WebSocketHandler;
import org.springframework.web.reactive.socket.server.RequestUpgradeStrategy;
import org.springframework.web.server.ServerWebExchange;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

2
spring-websocket/src/test/java/org/springframework/web/socket/TextMessageTests.java

@ -19,7 +19,7 @@ package org.springframework.web.socket; @@ -19,7 +19,7 @@ package org.springframework.web.socket;
import org.hamcrest.Matchers;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Test fixture for {@link TextMessage}.

1
spring-websocket/src/test/java/org/springframework/web/socket/WebSocketExtensionTests.java

@ -21,6 +21,7 @@ import java.util.List; @@ -21,6 +21,7 @@ import java.util.List;
import org.hamcrest.Matchers;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-websocket/src/test/java/org/springframework/web/socket/adapter/standard/ConvertingEncoderDecoderSupportTests.java

@ -40,8 +40,8 @@ import org.springframework.web.context.WebApplicationContext; @@ -40,8 +40,8 @@ import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.socket.ContextLoaderTestUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Test for {@link org.springframework.web.socket.adapter.standard.ConvertingEncoderDecoderSupport}.

1
spring-websocket/src/test/java/org/springframework/web/socket/config/HandlersBeanDefinitionParserTests.java

@ -60,6 +60,7 @@ import org.springframework.web.socket.sockjs.transport.handler.XhrPollingTranspo @@ -60,6 +60,7 @@ import org.springframework.web.socket.sockjs.transport.handler.XhrPollingTranspo
import org.springframework.web.socket.sockjs.transport.handler.XhrReceivingTransportHandler;
import org.springframework.web.socket.sockjs.transport.handler.XhrStreamingTransportHandler;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-websocket/src/test/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParserTests.java

@ -90,6 +90,7 @@ import org.springframework.web.socket.sockjs.transport.TransportType; @@ -90,6 +90,7 @@ import org.springframework.web.socket.sockjs.transport.TransportType;
import org.springframework.web.socket.sockjs.transport.handler.DefaultSockJsService;
import org.springframework.web.socket.sockjs.transport.handler.WebSocketTransportHandler;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

2
spring-websocket/src/test/java/org/springframework/web/socket/handler/WebSocketHttpHeadersTests.java

@ -26,7 +26,7 @@ import org.junit.Test; @@ -26,7 +26,7 @@ import org.junit.Test;
import org.springframework.web.socket.WebSocketExtension;
import org.springframework.web.socket.WebSocketHttpHeaders;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Unit tests for WebSocketHttpHeaders.

1
spring-websocket/src/test/java/org/springframework/web/socket/messaging/StompSubProtocolHandlerTests.java

@ -59,6 +59,7 @@ import org.springframework.web.socket.WebSocketMessage; @@ -59,6 +59,7 @@ import org.springframework.web.socket.WebSocketMessage;
import org.springframework.web.socket.handler.TestWebSocketSession;
import org.springframework.web.socket.sockjs.transport.SockJsSession;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.any;

7
spring-websocket/src/test/java/org/springframework/web/socket/messaging/WebSocketStompClientIntegrationTests.java

@ -13,10 +13,8 @@ @@ -13,10 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.socket.messaging;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
package org.springframework.web.socket.messaging;
import java.lang.reflect.Type;
import java.util.ArrayList;
@ -50,6 +48,9 @@ import org.springframework.web.socket.server.RequestUpgradeStrategy; @@ -50,6 +48,9 @@ import org.springframework.web.socket.server.RequestUpgradeStrategy;
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Integration tests for {@link WebSocketStompClient}.

1
spring-websocket/src/test/java/org/springframework/web/socket/sockjs/client/ClientSockJsSessionTests.java

@ -37,6 +37,7 @@ import org.springframework.web.socket.sockjs.frame.SockJsFrame; @@ -37,6 +37,7 @@ import org.springframework.web.socket.sockjs.frame.SockJsFrame;
import org.springframework.web.socket.sockjs.transport.TransportType;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

5
spring-websocket/src/test/java/org/springframework/web/socket/sockjs/client/SockJsUrlInfoTests.java

@ -18,7 +18,6 @@ package org.springframework.web.socket.sockjs.client; @@ -18,7 +18,6 @@ package org.springframework.web.socket.sockjs.client;
import java.net.URI;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.web.socket.sockjs.transport.TransportType;
@ -29,11 +28,11 @@ import static org.junit.Assert.*; @@ -29,11 +28,11 @@ import static org.junit.Assert.*;
/**
* Unit tests for {@code SockJsUrlInfo}.
*
* @author Rossen Stoyanchev
*/
public class SockJsUrlInfoTests {
@Test
public void serverId() throws Exception {
SockJsUrlInfo info = new SockJsUrlInfo(new URI("https://example.com"));
@ -61,7 +60,7 @@ public class SockJsUrlInfoTests { @@ -61,7 +60,7 @@ public class SockJsUrlInfoTests {
private void testInfoUrl(String scheme, String expectedScheme) throws Exception {
SockJsUrlInfo info = new SockJsUrlInfo(new URI(scheme + "://example.com"));
Assert.assertThat(info.getInfoUrl(), is(equalTo(new URI(expectedScheme + "://example.com/info"))));
assertThat(info.getInfoUrl(), is(equalTo(new URI(expectedScheme + "://example.com/info"))));
}
@Test

Loading…
Cancel
Save