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
c79fdfb668
  1. 1
      spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java
  2. 1
      spring-aop/src/test/java/org/springframework/aop/framework/ProxyFactoryTests.java
  3. 1
      spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java
  4. 1
      spring-beans/src/test/java/org/springframework/beans/AbstractPropertyAccessorTests.java
  5. 1
      spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java
  6. 1
      spring-beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java
  7. 2
      spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoFactoryTests.java
  8. 1
      spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
  9. 1
      spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java
  10. 2
      spring-beans/src/test/java/org/springframework/beans/PropertyMatchesTests.java
  11. 2
      spring-beans/src/test/java/org/springframework/beans/SimplePropertyDescriptorTests.java
  12. 1
      spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
  13. 1
      spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java
  14. 1
      spring-beans/src/test/java/org/springframework/beans/factory/Spr5475Tests.java
  15. 2
      spring-beans/src/test/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBeanTests.java
  16. 2
      spring-beans/src/test/java/org/springframework/beans/factory/support/Spr8954Tests.java
  17. 1
      spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests.java
  18. 2
      spring-beans/src/test/java/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests.java
  19. 2
      spring-beans/src/test/java/org/springframework/beans/factory/xml/NestedBeansElementTests.java
  20. 2
      spring-beans/src/test/java/org/springframework/beans/factory/xml/ProfileXmlBeanDefinitionTests.java
  21. 6
      spring-context-indexer/src/test/java/org/springframework/context/index/processor/CandidateComponentsIndexerTests.java
  22. 2
      spring-context-indexer/src/test/java/org/springframework/context/index/processor/PropertiesMarshallerTests.java
  23. 1
      spring-context-support/src/test/java/org/springframework/cache/transaction/AbstractTransactionSupportingCacheManagerTests.java
  24. 1
      spring-context-support/src/test/java/org/springframework/validation/beanvalidation2/SpringValidatorAdapterTests.java
  25. 1
      spring-context-support/src/test/java/org/springframework/validation/beanvalidation2/ValidatorFactoryTests.java
  26. 1
      spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java
  27. 2
      spring-context/src/test/java/org/springframework/aop/framework/ObjenesisProxyTests.java
  28. 1
      spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests.java
  29. 1
      spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java
  30. 1
      spring-context/src/test/java/org/springframework/cache/AbstractCacheTests.java
  31. 1
      spring-context/src/test/java/org/springframework/cache/annotation/AnnotationCacheOperationSourceTests.java
  32. 1
      spring-context/src/test/java/org/springframework/cache/config/AbstractCacheAnnotationTests.java
  33. 1
      spring-context/src/test/java/org/springframework/cache/interceptor/ExpressionEvaluatorTests.java
  34. 2
      spring-context/src/test/java/org/springframework/cache/interceptor/SimpleKeyGeneratorTests.java
  35. 1
      spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java
  36. 2
      spring-context/src/test/java/org/springframework/context/annotation/BeanMethodMetadataTests.java
  37. 1
      spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java
  38. 1
      spring-context/src/test/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProviderTests.java
  39. 1
      spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationIntegrationTests.java
  40. 2
      spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationRecursionTests.java
  41. 1
      spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserTests.java
  42. 3
      spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassAndBFPPTests.java
  43. 2
      spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostConstructAndAutowiringTests.java
  44. 1
      spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassWithConditionTests.java
  45. 2
      spring-context/src/test/java/org/springframework/context/annotation/DestroyMethodInferenceTests.java
  46. 1
      spring-context/src/test/java/org/springframework/context/annotation/EnableAspectJAutoProxyTests.java
  47. 1
      spring-context/src/test/java/org/springframework/context/annotation/ImportAwareTests.java
  48. 2
      spring-context/src/test/java/org/springframework/context/annotation/ImportBeanDefinitionRegistrarTests.java
  49. 3
      spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java
  50. 1
      spring-context/src/test/java/org/springframework/context/annotation/NestedConfigurationClassTests.java
  51. 2
      spring-context/src/test/java/org/springframework/context/annotation/PrimitiveBeanLookupAndAutowiringTests.java
  52. 1
      spring-context/src/test/java/org/springframework/context/annotation/PropertySourceAnnotationTests.java
  53. 1
      spring-context/src/test/java/org/springframework/context/annotation/ReflectionUtilsIntegrationTests.java
  54. 2
      spring-context/src/test/java/org/springframework/context/annotation/RoleAndDescriptionAnnotationTests.java
  55. 2
      spring-context/src/test/java/org/springframework/context/annotation/Spr12278Tests.java
  56. 2
      spring-context/src/test/java/org/springframework/context/annotation/Spr6602Tests.java
  57. 2
      spring-context/src/test/java/org/springframework/context/annotation/Spr8954Tests.java
  58. 1
      spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java
  59. 1
      spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanMethodQualificationTests.java
  60. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationBeanNameTests.java
  61. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java
  62. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassWithPlaceholderConfigurerBeanTests.java
  63. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationMetaAnnotationTests.java
  64. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java
  65. 1
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportResourceTests.java
  66. 1
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java
  67. 1
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportedConfigurationClassEnhancementTests.java
  68. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/PackagePrivateBeanMethodInheritanceTests.java
  69. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/Spr10744Tests.java
  70. 3
      spring-context/src/test/java/org/springframework/context/annotation/configuration/Spr7167Tests.java
  71. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/Spr9031Tests.java
  72. 4
      spring-context/src/test/java/org/springframework/context/annotation/spr10546/Spr10546Tests.java
  73. 2
      spring-context/src/test/java/org/springframework/context/annotation/spr8761/Spr8761Tests.java
  74. 1
      spring-context/src/test/java/org/springframework/context/event/AnnotationDrivenEventListenerTests.java
  75. 2
      spring-context/src/test/java/org/springframework/context/index/CandidateComponentsIndexLoaderTests.java
  76. 2
      spring-context/src/test/java/org/springframework/context/index/CandidateComponentsIndexTests.java
  77. 1
      spring-context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java
  78. 2
      spring-context/src/test/java/org/springframework/context/support/EnvironmentIntegrationTests.java
  79. 2
      spring-context/src/test/java/org/springframework/context/support/EnvironmentSecurityManagerIntegrationTests.java
  80. 2
      spring-context/src/test/java/org/springframework/context/support/GenericXmlApplicationContextTests.java
  81. 1
      spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java
  82. 2
      spring-context/src/test/java/org/springframework/context/support/SerializableBeanFactoryMemoryLeakTests.java
  83. 2
      spring-context/src/test/java/org/springframework/format/datetime/DateFormatterTests.java
  84. 2
      spring-context/src/test/java/org/springframework/format/datetime/joda/DateTimeFormatterFactoryBeanTests.java
  85. 1
      spring-context/src/test/java/org/springframework/format/datetime/joda/DateTimeFormatterFactoryTests.java
  86. 2
      spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormatterFactoryBeanTests.java
  87. 1
      spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormatterFactoryTests.java
  88. 2
      spring-context/src/test/java/org/springframework/jndi/JndiLocatorDelegateTests.java
  89. 1
      spring-context/src/test/java/org/springframework/jndi/JndiPropertySourceTests.java
  90. 2
      spring-context/src/test/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptorTests.java
  91. 5
      spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java
  92. 1
      spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java
  93. 1
      spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java
  94. 3
      spring-context/src/test/java/org/springframework/validation/DefaultMessageCodesResolverTests.java
  95. 1
      spring-context/src/test/java/org/springframework/validation/beanvalidation/SpringValidatorAdapterTests.java
  96. 1
      spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java
  97. 2
      src/test/java/com/foo/ComponentBeanDefinitionParserTests.java
  98. 1
      src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java
  99. 1
      src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java
  100. 1
      src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java
  101. Some files were not shown because too many files have changed in this diff Show More

1
spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java

@ -59,6 +59,7 @@ import org.springframework.tests.sample.beans.TestBean; @@ -59,6 +59,7 @@ import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.ObjectUtils;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-aop/src/test/java/org/springframework/aop/framework/ProxyFactoryTests.java

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

1
spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java

@ -35,6 +35,7 @@ import org.springframework.tests.sample.beans.TestBean; @@ -35,6 +35,7 @@ import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.SerializationTestUtils;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

1
spring-beans/src/test/java/org/springframework/beans/AbstractPropertyAccessorTests.java

@ -64,6 +64,7 @@ import static org.hamcrest.CoreMatchers.is; @@ -64,6 +64,7 @@ import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java

@ -23,6 +23,7 @@ import org.junit.Before; @@ -23,6 +23,7 @@ import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java

@ -26,6 +26,7 @@ import org.springframework.core.OverridingClassLoader; @@ -26,6 +26,7 @@ import org.springframework.core.OverridingClassLoader;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoFactoryTests.java

@ -21,7 +21,7 @@ import java.beans.IntrospectionException; @@ -21,7 +21,7 @@ import java.beans.IntrospectionException;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Unit tests for {@link ExtendedBeanInfoTests}.

1
spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java

@ -29,6 +29,7 @@ import org.springframework.tests.sample.beans.TestBean; @@ -29,6 +29,7 @@ import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java

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

2
spring-beans/src/test/java/org/springframework/beans/PropertyMatchesTests.java

@ -18,8 +18,8 @@ package org.springframework.beans; @@ -18,8 +18,8 @@ package org.springframework.beans;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Tests for {@link PropertyMatches}.

2
spring-beans/src/test/java/org/springframework/beans/SimplePropertyDescriptorTests.java

@ -24,7 +24,7 @@ import java.lang.reflect.Method; @@ -24,7 +24,7 @@ import java.lang.reflect.Method;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author Chris Beams

1
spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java

@ -103,6 +103,7 @@ import org.springframework.util.StopWatch; @@ -103,6 +103,7 @@ import org.springframework.util.StopWatch;
import org.springframework.util.StringValueResolver;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

1
spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java

@ -26,6 +26,7 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; @@ -26,6 +26,7 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-beans/src/test/java/org/springframework/beans/factory/Spr5475Tests.java

@ -24,6 +24,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory; @@ -24,6 +24,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;

2
spring-beans/src/test/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBeanTests.java

@ -29,8 +29,8 @@ import org.yaml.snakeyaml.scanner.ScannerException; @@ -29,8 +29,8 @@ import org.yaml.snakeyaml.scanner.ScannerException;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.ClassPathResource;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.beans.factory.config.YamlProcessor.*;
/**

2
spring-beans/src/test/java/org/springframework/beans/factory/support/Spr8954Tests.java

@ -27,7 +27,7 @@ import org.springframework.beans.factory.config.InstantiationAwareBeanPostProces @@ -27,7 +27,7 @@ import org.springframework.beans.factory.config.InstantiationAwareBeanPostProces
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Unit tests for SPR-8954, in which a custom {@link InstantiationAwareBeanPostProcessor}

1
spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests.java

@ -23,6 +23,7 @@ import org.springframework.core.io.ClassPathResource; @@ -23,6 +23,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-beans/src/test/java/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests.java

@ -25,8 +25,8 @@ import org.springframework.tests.sample.beans.TestBean; @@ -25,8 +25,8 @@ import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.*;
/**
* Tests for propagating enclosing beans element defaults to nested beans elements.

2
spring-beans/src/test/java/org/springframework/beans/factory/xml/NestedBeansElementTests.java

@ -9,7 +9,7 @@ import org.springframework.core.io.ClassPathResource; @@ -9,7 +9,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests for new nested beans element support in Spring XML

2
spring-beans/src/test/java/org/springframework/beans/factory/xml/ProfileXmlBeanDefinitionTests.java

@ -28,7 +28,7 @@ import org.springframework.core.env.StandardEnvironment; @@ -28,7 +28,7 @@ import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.ClassPathResource;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests various combinations of profile declarations against various profile

6
spring-context-indexer/src/test/java/org/springframework/context/index/processor/CandidateComponentsIndexerTests.java

@ -30,7 +30,6 @@ import javax.transaction.Transactional; @@ -30,7 +30,6 @@ import javax.transaction.Transactional;
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.context.index.sample.AbstractController;
@ -61,8 +60,8 @@ import org.springframework.context.index.test.TestCompiler; @@ -61,8 +60,8 @@ import org.springframework.context.index.test.TestCompiler;
import org.springframework.stereotype.Component;
import org.springframework.util.ClassUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.context.index.processor.Metadata.*;
/**
@ -78,9 +77,6 @@ public class CandidateComponentsIndexerTests { @@ -78,9 +77,6 @@ public class CandidateComponentsIndexerTests {
@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();
@Rule
public ExpectedException thrown = ExpectedException.none();
@Before
public void createCompiler() throws IOException {

2
spring-context-indexer/src/test/java/org/springframework/context/index/processor/PropertiesMarshallerTests.java

@ -24,8 +24,8 @@ import java.util.HashSet; @@ -24,8 +24,8 @@ import java.util.HashSet;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.context.index.processor.Metadata.*;
/**

1
spring-context-support/src/test/java/org/springframework/cache/transaction/AbstractTransactionSupportingCacheManagerTests.java vendored

@ -23,6 +23,7 @@ import org.junit.rules.TestName; @@ -23,6 +23,7 @@ import org.junit.rules.TestName;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-context-support/src/test/java/org/springframework/validation/beanvalidation2/SpringValidatorAdapterTests.java

@ -56,6 +56,7 @@ import org.springframework.validation.beanvalidation.SpringValidatorAdapter; @@ -56,6 +56,7 @@ import org.springframework.validation.beanvalidation.SpringValidatorAdapter;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.*;
import static org.hamcrest.core.StringContains.*;
import static org.junit.Assert.*;

1
spring-context-support/src/test/java/org/springframework/validation/beanvalidation2/ValidatorFactoryTests.java

@ -52,6 +52,7 @@ import org.springframework.validation.FieldError; @@ -52,6 +52,7 @@ import org.springframework.validation.FieldError;
import org.springframework.validation.ObjectError;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java

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

2
spring-context/src/test/java/org/springframework/aop/framework/ObjenesisProxyTests.java

@ -23,7 +23,7 @@ import org.springframework.context.ApplicationContext; @@ -23,7 +23,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Integration test for Objenesis proxy creation.

1
spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests.java

@ -62,6 +62,7 @@ import org.springframework.tests.sample.beans.TestBean; @@ -62,6 +62,7 @@ import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.SerializationTestUtils;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java

@ -68,6 +68,7 @@ import org.springframework.util.SerializationTestUtils; @@ -68,6 +68,7 @@ import org.springframework.util.SerializationTestUtils;
import org.springframework.util.StopWatch;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/cache/AbstractCacheTests.java vendored

@ -26,6 +26,7 @@ import org.junit.Rule; @@ -26,6 +26,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.*;
import static org.junit.Assert.*;

1
spring-context/src/test/java/org/springframework/cache/annotation/AnnotationCacheOperationSourceTests.java vendored

@ -36,6 +36,7 @@ import org.springframework.cache.interceptor.CacheableOperation; @@ -36,6 +36,7 @@ import org.springframework.cache.interceptor.CacheableOperation;
import org.springframework.core.annotation.AliasFor;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/cache/config/AbstractCacheAnnotationTests.java vendored

@ -31,6 +31,7 @@ import org.springframework.cache.CacheManager; @@ -31,6 +31,7 @@ import org.springframework.cache.CacheManager;
import org.springframework.context.ConfigurableApplicationContext;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/cache/interceptor/ExpressionEvaluatorTests.java vendored

@ -36,6 +36,7 @@ import org.springframework.expression.EvaluationContext; @@ -36,6 +36,7 @@ import org.springframework.expression.EvaluationContext;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.util.ReflectionUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

2
spring-context/src/test/java/org/springframework/cache/interceptor/SimpleKeyGeneratorTests.java vendored

@ -18,8 +18,8 @@ package org.springframework.cache.interceptor; @@ -18,8 +18,8 @@ package org.springframework.cache.interceptor;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Tests for {@link SimpleKeyGenerator} and {@link SimpleKey}.

1
spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java

@ -34,6 +34,7 @@ import org.springframework.core.ResolvableType; @@ -34,6 +34,7 @@ import org.springframework.core.ResolvableType;
import org.springframework.util.ObjectUtils;
import static java.lang.String.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.util.StringUtils.*;

2
spring-context/src/test/java/org/springframework/context/annotation/BeanMethodMetadataTests.java

@ -25,8 +25,8 @@ import org.junit.Test; @@ -25,8 +25,8 @@ import org.junit.Test;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.config.BeanDefinition;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* @author Phillip Webb

1
spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java

@ -26,6 +26,7 @@ import org.springframework.aop.support.DefaultPointcutAdvisor; @@ -26,6 +26,7 @@ import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProviderTests.java

@ -56,6 +56,7 @@ import org.springframework.stereotype.Repository; @@ -56,6 +56,7 @@ import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationIntegrationTests.java

@ -63,6 +63,7 @@ import org.springframework.tests.context.SimpleMapScope; @@ -63,6 +63,7 @@ import org.springframework.tests.context.SimpleMapScope;
import org.springframework.util.SerializationTestUtils;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;

2
spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationRecursionTests.java

@ -24,7 +24,7 @@ import org.springframework.context.annotation.componentscan.level2.Level2Config; @@ -24,7 +24,7 @@ import org.springframework.context.annotation.componentscan.level2.Level2Config;
import org.springframework.context.annotation.componentscan.level3.Level3Component;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests ensuring that configuration classes marked with @ComponentScan

1
spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserTests.java

@ -34,6 +34,7 @@ import org.springframework.core.type.classreading.MetadataReaderFactory; @@ -34,6 +34,7 @@ import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

3
spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassAndBFPPTests.java

@ -25,7 +25,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; @@ -25,7 +25,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests semantics of declaring {@link BeanFactoryPostProcessor}-returning @Bean
@ -115,5 +115,4 @@ public class ConfigurationClassAndBFPPTests { @@ -115,5 +115,4 @@ public class ConfigurationClassAndBFPPTests {
}
}
}

2
spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostConstructAndAutowiringTests.java

@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests cornering the issue reported in SPR-8080. If the product of a @Bean method

1
spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassWithConditionTests.java

@ -32,6 +32,7 @@ import org.springframework.core.type.AnnotationMetadata; @@ -32,6 +32,7 @@ import org.springframework.core.type.AnnotationMetadata;
import org.springframework.stereotype.Component;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-context/src/test/java/org/springframework/context/annotation/DestroyMethodInferenceTests.java

@ -25,7 +25,7 @@ import org.springframework.context.ConfigurableApplicationContext; @@ -25,7 +25,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author Chris Beams

1
spring-context/src/test/java/org/springframework/context/annotation/EnableAspectJAutoProxyTests.java

@ -33,6 +33,7 @@ import org.springframework.context.ApplicationContext; @@ -33,6 +33,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/context/annotation/ImportAwareTests.java

@ -37,6 +37,7 @@ import org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcesso @@ -37,6 +37,7 @@ import org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcesso
import org.springframework.util.Assert;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-context/src/test/java/org/springframework/context/annotation/ImportBeanDefinitionRegistrarTests.java

@ -36,7 +36,7 @@ import org.springframework.core.io.ResourceLoader; @@ -36,7 +36,7 @@ import org.springframework.core.io.ResourceLoader;
import org.springframework.core.type.AnnotationMetadata;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Integration tests for {@link ImportBeanDefinitionRegistrar}.

3
spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java

@ -53,9 +53,8 @@ import org.springframework.lang.Nullable; @@ -53,9 +53,8 @@ import org.springframework.lang.Nullable;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.*;
/**

1
spring-context/src/test/java/org/springframework/context/annotation/NestedConfigurationClassTests.java

@ -22,6 +22,7 @@ import org.springframework.stereotype.Component; @@ -22,6 +22,7 @@ import org.springframework.stereotype.Component;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-context/src/test/java/org/springframework/context/annotation/PrimitiveBeanLookupAndAutowiringTests.java

@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests changes introduced for SPR-8874, allowing beans of primitive types to be looked

1
spring-context/src/test/java/org/springframework/context/annotation/PropertySourceAnnotationTests.java

@ -41,6 +41,7 @@ import org.springframework.core.io.support.PropertySourceFactory; @@ -41,6 +41,7 @@ import org.springframework.core.io.support.PropertySourceFactory;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/context/annotation/ReflectionUtilsIntegrationTests.java

@ -23,6 +23,7 @@ import org.junit.Test; @@ -23,6 +23,7 @@ import org.junit.Test;
import org.springframework.util.ReflectionUtils;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-context/src/test/java/org/springframework/context/annotation/RoleAndDescriptionAnnotationTests.java

@ -23,7 +23,7 @@ import org.springframework.context.annotation.role.ComponentWithRole; @@ -23,7 +23,7 @@ import org.springframework.context.annotation.role.ComponentWithRole;
import org.springframework.context.annotation.role.ComponentWithoutRole;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests the use of the @Role and @Description annotation on @Bean methods and @Component classes.

2
spring-context/src/test/java/org/springframework/context/annotation/Spr12278Tests.java

@ -23,8 +23,8 @@ import org.junit.rules.ExpectedException; @@ -23,8 +23,8 @@ import org.junit.rules.ExpectedException;
import org.springframework.beans.factory.BeanCreationException;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.*;
import static org.junit.Assert.*;
/**
* @author Stephane Nicoll

2
spring-context/src/test/java/org/springframework/context/annotation/Spr6602Tests.java

@ -23,7 +23,7 @@ import org.springframework.context.ApplicationContext; @@ -23,7 +23,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests to verify that FactoryBean semantics are the same in Configuration

2
spring-context/src/test/java/org/springframework/context/annotation/Spr8954Tests.java

@ -26,7 +26,7 @@ import org.springframework.beans.factory.config.InstantiationAwareBeanPostProces @@ -26,7 +26,7 @@ import org.springframework.beans.factory.config.InstantiationAwareBeanPostProces
import org.springframework.beans.factory.support.RootBeanDefinition;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Unit tests for SPR-8954, in which a custom {@link InstantiationAwareBeanPostProcessor}

1
spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java

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

1
spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanMethodQualificationTests.java

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

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationBeanNameTests.java

@ -28,7 +28,7 @@ import org.springframework.context.annotation.Import; @@ -28,7 +28,7 @@ import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Unit tests ensuring that configuration class bean names as expressed via @Configuration

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java

@ -36,7 +36,7 @@ import org.springframework.core.io.ClassPathResource; @@ -36,7 +36,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* System tests covering use of AspectJ {@link Aspect}s in conjunction with {@link Configuration} classes.

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassWithPlaceholderConfigurerBeanTests.java

@ -27,7 +27,7 @@ import org.springframework.tests.sample.beans.ITestBean; @@ -27,7 +27,7 @@ import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* A configuration class that registers a non-static placeholder configurer {@code @Bean}

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationMetaAnnotationTests.java

@ -27,7 +27,7 @@ import org.springframework.context.annotation.Configuration; @@ -27,7 +27,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Ensures that @Configuration is supported properly as a meta-annotation.

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java

@ -30,7 +30,7 @@ import org.springframework.context.annotation.Import; @@ -30,7 +30,7 @@ import org.springframework.context.annotation.Import;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests that @Import may be used both as a locally declared and meta-declared

1
spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportResourceTests.java

@ -35,6 +35,7 @@ import org.springframework.core.env.PropertySource; @@ -35,6 +35,7 @@ import org.springframework.core.env.PropertySource;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java

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

1
spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportedConfigurationClassEnhancementTests.java

@ -28,6 +28,7 @@ import org.springframework.tests.sample.beans.TestBean; @@ -28,6 +28,7 @@ import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.ClassUtils;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/PackagePrivateBeanMethodInheritanceTests.java

@ -23,7 +23,7 @@ import org.springframework.context.annotation.Bean; @@ -23,7 +23,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Reproduces SPR-8756, which has been marked as "won't fix" for reasons

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/Spr10744Tests.java

@ -25,8 +25,8 @@ import org.springframework.context.annotation.Configuration; @@ -25,8 +25,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* @author Phillip Webb

3
spring-context/src/test/java/org/springframework/context/annotation/configuration/Spr7167Tests.java

@ -29,9 +29,11 @@ import org.springframework.context.annotation.Configuration; @@ -29,9 +29,11 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.util.ClassUtils;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
public class Spr7167Tests {
@Test
public void test() {
ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(MyConfig.class);
@ -43,6 +45,7 @@ public class Spr7167Tests { @@ -43,6 +45,7 @@ public class Spr7167Tests {
MyConfig config = ctx.getBean(MyConfig.class);
assertTrue("Config class was not enhanced", ClassUtils.isCglibProxy(config));
}
}
@Configuration

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/Spr9031Tests.java

@ -27,7 +27,7 @@ import org.springframework.context.annotation.Import; @@ -27,7 +27,7 @@ import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.configuration.spr9031.scanpackage.Spr9031Component;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Unit tests cornering bug SPR-9031.

4
spring-context/src/test/java/org/springframework/context/annotation/spr10546/Spr10546Tests.java

@ -26,10 +26,9 @@ import org.springframework.context.annotation.Import; @@ -26,10 +26,9 @@ import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.spr10546.scanpackage.AEnclosingConfig;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
*
* @author Rob Winch
*/
public class Spr10546Tests {
@ -146,4 +145,5 @@ public class Spr10546Tests { @@ -146,4 +145,5 @@ public class Spr10546Tests {
context = new AnnotationConfigApplicationContext(annotatedClasses);
assertThat(context.getBean("myBean",String.class), equalTo("myBean"));
}
}

2
spring-context/src/test/java/org/springframework/context/annotation/spr8761/Spr8761Tests.java

@ -25,7 +25,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext @@ -25,7 +25,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.stereotype.Component;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests cornering the regression reported in SPR-8761.

1
spring-context/src/test/java/org/springframework/context/event/AnnotationDrivenEventListenerTests.java

@ -66,6 +66,7 @@ import org.springframework.util.Assert; @@ -66,6 +66,7 @@ import org.springframework.util.Assert;
import org.springframework.validation.annotation.Validated;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

2
spring-context/src/test/java/org/springframework/context/index/CandidateComponentsIndexLoaderTests.java

@ -26,7 +26,7 @@ import org.junit.rules.ExpectedException; @@ -26,7 +26,7 @@ import org.junit.rules.ExpectedException;
import org.springframework.core.io.ClassPathResource;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests for {@link CandidateComponentsIndexLoader}.

2
spring-context/src/test/java/org/springframework/context/index/CandidateComponentsIndexTests.java

@ -23,8 +23,8 @@ import java.util.Set; @@ -23,8 +23,8 @@ import java.util.Set;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Tests for {@link CandidateComponentsIndex}.

1
spring-context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java

@ -34,6 +34,7 @@ import org.springframework.core.io.FileSystemResource; @@ -34,6 +34,7 @@ import org.springframework.core.io.FileSystemResource;
import org.springframework.lang.Nullable;
import org.springframework.tests.sample.beans.ResourceTestBean;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

2
spring-context/src/test/java/org/springframework/context/support/EnvironmentIntegrationTests.java

@ -25,7 +25,7 @@ import org.springframework.core.env.ConfigurableEnvironment; @@ -25,7 +25,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests covering the integration of the {@link Environment} into

2
spring-context/src/test/java/org/springframework/context/support/EnvironmentSecurityManagerIntegrationTests.java

@ -33,7 +33,7 @@ import org.springframework.stereotype.Component; @@ -33,7 +33,7 @@ import org.springframework.stereotype.Component;
import static java.lang.String.format;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests integration between Environment and SecurityManagers. See SPR-9970.

2
spring-context/src/test/java/org/springframework/context/support/GenericXmlApplicationContextTests.java

@ -6,7 +6,7 @@ import org.springframework.context.ApplicationContext; @@ -6,7 +6,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.util.ClassUtils;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Unit tests for {@link GenericXmlApplicationContext}.

1
spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java

@ -36,6 +36,7 @@ import org.springframework.mock.env.MockPropertySource; @@ -36,6 +36,7 @@ import org.springframework.mock.env.MockPropertySource;
import org.springframework.tests.sample.beans.TestBean;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;

2
spring-context/src/test/java/org/springframework/context/support/SerializableBeanFactoryMemoryLeakTests.java

@ -30,7 +30,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory; @@ -30,7 +30,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.ConfigurableApplicationContext;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;
/**

2
spring-context/src/test/java/org/springframework/format/datetime/DateFormatterTests.java

@ -32,8 +32,8 @@ import org.junit.rules.ExpectedException; @@ -32,8 +32,8 @@ import org.junit.rules.ExpectedException;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Tests for {@link DateFormatter}.

2
spring-context/src/test/java/org/springframework/format/datetime/joda/DateTimeFormatterFactoryBeanTests.java

@ -21,7 +21,7 @@ import org.joda.time.format.DateTimeFormatter; @@ -21,7 +21,7 @@ import org.joda.time.format.DateTimeFormatter;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author Phillip Webb

1
spring-context/src/test/java/org/springframework/format/datetime/joda/DateTimeFormatterFactoryTests.java

@ -27,6 +27,7 @@ import org.junit.Test; @@ -27,6 +27,7 @@ import org.junit.Test;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

2
spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormatterFactoryBeanTests.java

@ -22,7 +22,7 @@ import java.time.format.FormatStyle; @@ -22,7 +22,7 @@ import java.time.format.FormatStyle;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author Phillip Webb

1
spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormatterFactoryTests.java

@ -28,6 +28,7 @@ import org.junit.Test; @@ -28,6 +28,7 @@ import org.junit.Test;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

2
spring-context/src/test/java/org/springframework/jndi/JndiLocatorDelegateTests.java

@ -22,7 +22,7 @@ import javax.naming.spi.NamingManager; @@ -22,7 +22,7 @@ import javax.naming.spi.NamingManager;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests for {@link JndiLocatorDelegate}.

1
spring-context/src/test/java/org/springframework/jndi/JndiPropertySourceTests.java

@ -24,6 +24,7 @@ import org.junit.Test; @@ -24,6 +24,7 @@ import org.junit.Test;
import org.springframework.tests.mock.jndi.SimpleNamingContext;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

2
spring-context/src/test/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptorTests.java

@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy; @@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Unit tests for {@link AnnotationAsyncExecutionInterceptor}.

5
spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java

@ -28,7 +28,6 @@ import java.util.concurrent.Future; @@ -28,7 +28,6 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.awaitility.Awaitility;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
@ -55,6 +54,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @@ -55,6 +54,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;
import org.springframework.util.ReflectionUtils;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
@ -326,6 +326,7 @@ public class EnableAsyncTests { @@ -326,6 +326,7 @@ public class EnableAsyncTests {
}
@Test
@SuppressWarnings("resource")
public void exceptionThrownWithBeanNotOfRequiredTypeRootCause() {
try {
new AnnotationConfigApplicationContext(JdkProxyConfiguration.class);
@ -336,7 +337,7 @@ public class EnableAsyncTests { @@ -336,7 +337,7 @@ public class EnableAsyncTests {
while (ex.getCause() != null) {
ex = ex.getCause();
}
Assert.assertThat(ex, instanceOf(BeanNotOfRequiredTypeException.class));
assertThat(ex, instanceOf(BeanNotOfRequiredTypeException.class));
}
}

1
spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java

@ -35,6 +35,7 @@ import org.springframework.scheduling.config.TaskManagementConfigUtils; @@ -35,6 +35,7 @@ import org.springframework.scheduling.config.TaskManagementConfigUtils;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

1
spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java

@ -31,6 +31,7 @@ import org.springframework.scheduling.TriggerContext; @@ -31,6 +31,7 @@ import org.springframework.scheduling.TriggerContext;
import org.springframework.scheduling.support.ScheduledMethodRunnable;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

3
spring-context/src/test/java/org/springframework/validation/DefaultMessageCodesResolverTests.java

@ -22,7 +22,7 @@ import org.springframework.tests.sample.beans.TestBean; @@ -22,7 +22,7 @@ import org.springframework.tests.sample.beans.TestBean;
import org.springframework.validation.DefaultMessageCodesResolver.Format;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests for {@link DefaultMessageCodesResolver}.
@ -157,4 +157,5 @@ public class DefaultMessageCodesResolverTests { @@ -157,4 +157,5 @@ public class DefaultMessageCodesResolverTests {
"CUSTOM-errorCode.objectName",
"CUSTOM-errorCode" })));
}
}

1
spring-context/src/test/java/org/springframework/validation/beanvalidation/SpringValidatorAdapterTests.java

@ -53,6 +53,7 @@ import org.springframework.validation.FieldError; @@ -53,6 +53,7 @@ import org.springframework.validation.FieldError;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.*;
import static org.hamcrest.core.StringContains.*;
import static org.junit.Assert.*;

1
spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java

@ -51,6 +51,7 @@ import org.springframework.validation.Errors; @@ -51,6 +51,7 @@ import org.springframework.validation.Errors;
import org.springframework.validation.FieldError;
import org.springframework.validation.ObjectError;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

2
src/test/java/com/foo/ComponentBeanDefinitionParserTests.java

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
package com.foo;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.List;

1
src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java vendored

@ -34,6 +34,7 @@ import org.springframework.context.annotation.Configuration; @@ -34,6 +34,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Repository;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
/**

1
src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java vendored

@ -58,6 +58,7 @@ import org.springframework.web.context.support.StaticWebApplicationContext; @@ -58,6 +58,7 @@ import org.springframework.web.context.support.StaticWebApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;
import static org.springframework.context.ConfigurableApplicationContext.*;

1
src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java

@ -40,6 +40,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @@ -40,6 +40,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;

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

Loading…
Cancel
Save