Replace AssertionsForClassTypes with Assertions
Closes gh-34821 Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
parent
977792009d
commit
7f6a7b806e
|
@ -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}.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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
|
|||
|
||||
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
|
|||
|
||||
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
|
|||
|
||||
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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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}.
|
||||
|
|
|
@ -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…
Reference in New Issue