Browse Source

Replace AssertionsForClassTypes with Assertions

Closes gh-34821

Signed-off-by: Johnny Lim <izeye@naver.com>
pull/35004/head
Johnny Lim 8 months ago committed by Sam Brannen
parent
commit
7f6a7b806e
  1. 2
      spring-beans/src/test/java/org/springframework/beans/factory/support/CglibSubclassingInstantiationStrategyTests.java
  2. 2
      spring-context/src/test/java/org/springframework/cache/annotation/ReactiveCachingTests.java
  3. 2
      spring-core/src/test/java/org/springframework/core/serializer/SerializerTests.java
  4. 10
      spring-test/src/test/java/org/springframework/test/context/support/BootstrapTestUtilsMergedConfigTests.java
  5. 2
      spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java
  6. 2
      spring-web/src/test/java/org/springframework/core/convert/support/IntegerToEnumConverterFactoryTests.java
  7. 4
      spring-web/src/test/java/org/springframework/web/accept/DefaultApiVersionStrategiesTests.java
  8. 2
      spring-web/src/test/java/org/springframework/web/accept/PathApiVersionResolverTests.java
  9. 2
      spring-web/src/test/java/org/springframework/web/accept/SemanticApiVersionParserTests.java
  10. 4
      spring-webflux/src/test/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategiesTests.java
  11. 2
      spring-webflux/src/test/java/org/springframework/web/reactive/accept/PathApiVersionResolverTests.java
  12. 4
      spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/VersionRequestConditionTests.java
  13. 2
      spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentViewResolutionResultHandlerTests.java
  14. 2
      spring-webflux/src/test/java/org/springframework/web/reactive/socket/server/upgrade/ReactorNettyRequestUpgradeStrategyTests.java
  15. 4
      spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/VersionRequestConditionTests.java
  16. 2
      spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java

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

@ -25,8 +25,8 @@ import org.assertj.core.api.ThrowableAssert.ThrowingCallable; @@ -25,8 +25,8 @@ import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
/**
* Tests for {@link CglibSubclassingInstantiationStrategy}.

2
spring-context/src/test/java/org/springframework/cache/annotation/ReactiveCachingTests.java vendored

@ -43,7 +43,7 @@ import org.springframework.context.annotation.Configuration; @@ -43,7 +43,7 @@ import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.AssertionsForClassTypes.catchThrowable;
import static org.assertj.core.api.Assertions.catchThrowable;
/**
* Tests for annotation-based caching methods that use reactive operators.

2
spring-core/src/test/java/org/springframework/core/serializer/SerializerTests.java

@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.core.serializer.support.SerializationDelegate;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link Serializer}, {@link Deserializer}, and {@link SerializationDelegate}.

10
spring-test/src/test/java/org/springframework/test/context/support/BootstrapTestUtilsMergedConfigTests.java

@ -21,7 +21,6 @@ import java.lang.annotation.Retention; @@ -21,7 +21,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.assertj.core.api.AssertionsForClassTypes;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.Configuration;
@ -271,10 +270,7 @@ class BootstrapTestUtilsMergedConfigTests extends AbstractContextConfigurationUt @@ -271,10 +270,7 @@ class BootstrapTestUtilsMergedConfigTests extends AbstractContextConfigurationUt
MergedContextConfiguration parent = mergedConfig.getParent();
assertThat(parent).as("parent config").isNotNull();
// The following does not work -- at least not in Eclipse.
// assertThat(parent.getClasses())...
// So we use AssertionsForClassTypes directly.
AssertionsForClassTypes.assertThat(parent.getClasses()).containsExactly(FooConfig.class);
assertThat(parent.getClasses()).containsExactly(FooConfig.class);
assertMergedConfig(mergedConfig, testClass, EMPTY_STRING_ARRAY, expectedClasses,
AnnotationConfigContextLoader.class);
@ -294,7 +290,7 @@ class BootstrapTestUtilsMergedConfigTests extends AbstractContextConfigurationUt @@ -294,7 +290,7 @@ class BootstrapTestUtilsMergedConfigTests extends AbstractContextConfigurationUt
MergedContextConfiguration parent = mergedConfig.getParent();
assertThat(parent).as("parent config").isNotNull();
AssertionsForClassTypes.assertThat(parent.getClasses()).containsExactly(FooConfig.class);
assertThat(parent.getClasses()).containsExactly(FooConfig.class);
assertMergedConfig(mergedConfig, enclosingTestClass, EMPTY_STRING_ARRAY, expectedClasses,
AnnotationConfigContextLoader.class);
@ -313,7 +309,7 @@ class BootstrapTestUtilsMergedConfigTests extends AbstractContextConfigurationUt @@ -313,7 +309,7 @@ class BootstrapTestUtilsMergedConfigTests extends AbstractContextConfigurationUt
MergedContextConfiguration parent = mergedConfig.getParent();
assertThat(parent).as("parent config").isNotNull();
AssertionsForClassTypes.assertThat(parent.getClasses()).containsExactly(FooConfig.class);
assertThat(parent.getClasses()).containsExactly(FooConfig.class);
assertMergedConfig(mergedConfig, testClass, EMPTY_STRING_ARRAY, expectedClasses,
AnnotationConfigContextLoader.class);

2
spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java

@ -48,7 +48,7 @@ import org.springframework.transaction.testfixture.CallCountingTransactionManage @@ -48,7 +48,7 @@ import org.springframework.transaction.testfixture.CallCountingTransactionManage
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatException;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.springframework.transaction.annotation.RollbackOn.ALL_EXCEPTIONS;
/**

2
spring-web/src/test/java/org/springframework/core/convert/support/IntegerToEnumConverterFactoryTests.java

@ -23,7 +23,7 @@ import org.junit.jupiter.params.provider.CsvSource; @@ -23,7 +23,7 @@ import org.junit.jupiter.params.provider.CsvSource;
import org.springframework.core.convert.converter.Converter;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
/**
* Tests for {@link IntegerToEnumConverterFactory}.

4
spring-web/src/test/java/org/springframework/web/accept/DefaultApiVersionStrategiesTests.java

@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test; @@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test;
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* Unit tests for {@link DefaultApiVersionStrategy}.

2
spring-web/src/test/java/org/springframework/web/accept/PathApiVersionResolverTests.java

@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test; @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
import org.springframework.web.util.ServletRequestPathUtils;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Unit tests for {@link PathApiVersionResolver}.

2
spring-web/src/test/java/org/springframework/web/accept/SemanticApiVersionParserTests.java

@ -20,8 +20,8 @@ import org.junit.jupiter.api.Test; @@ -20,8 +20,8 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
/**
* Unit tests for {@link SemanticApiVersionParser}.

4
spring-webflux/src/test/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategiesTests.java

@ -27,8 +27,8 @@ import org.springframework.web.server.ServerWebExchange; @@ -27,8 +27,8 @@ import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
import org.springframework.web.testfixture.server.MockServerWebExchange;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* Unit tests for {@link org.springframework.web.accept.DefaultApiVersionStrategy}.

2
spring-webflux/src/test/java/org/springframework/web/reactive/accept/PathApiVersionResolverTests.java

@ -22,7 +22,7 @@ import org.springframework.web.server.ServerWebExchange; @@ -22,7 +22,7 @@ import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
import org.springframework.web.testfixture.server.MockServerWebExchange;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Unit tests for {@link org.springframework.web.accept.PathApiVersionResolver}.

4
spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/VersionRequestConditionTests.java

@ -30,8 +30,8 @@ import org.springframework.web.server.ServerWebExchange; @@ -30,8 +30,8 @@ import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
import org.springframework.web.testfixture.server.MockServerWebExchange;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* Unit tests for {@link VersionRequestCondition}.

2
spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentViewResolutionResultHandlerTests.java

@ -47,7 +47,7 @@ import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRe @@ -47,7 +47,7 @@ import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRe
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
import org.springframework.web.testfixture.server.MockServerWebExchange;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.web.testfixture.method.ResolvableMethod.on;
/**

2
spring-webflux/src/test/java/org/springframework/web/reactive/socket/server/upgrade/ReactorNettyRequestUpgradeStrategyTests.java

@ -19,7 +19,7 @@ package org.springframework.web.reactive.socket.server.upgrade; @@ -19,7 +19,7 @@ package org.springframework.web.reactive.socket.server.upgrade;
import org.junit.jupiter.api.Test;
import reactor.netty.http.server.WebsocketServerSpec;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link ReactorNettyRequestUpgradeStrategy}.

4
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/VersionRequestConditionTests.java

@ -28,8 +28,8 @@ import org.springframework.web.accept.NotAcceptableApiVersionException; @@ -28,8 +28,8 @@ import org.springframework.web.accept.NotAcceptableApiVersionException;
import org.springframework.web.accept.SemanticApiVersionParser;
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* Unit tests for {@link VersionRequestCondition}.

2
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java

@ -33,7 +33,7 @@ import org.springframework.web.testfixture.servlet.MockHttpServletRequest; @@ -33,7 +33,7 @@ import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
import org.springframework.web.testfixture.servlet.MockServletConfig;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for API versioning.

Loading…
Cancel
Save