Skip to content

Replace AssertionsForClassTypes with Assertions #34821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -25,8 +25,8 @@
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}.
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@

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.
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@

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}.
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@
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 @@ public void buildMergedConfigForContextHierarchy() {

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 @@ public void buildMergedConfigForNestedTestClassWithInheritedConfigForContextHier

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 @@ public void buildMergedConfigForNestedTestClassWithMergedInheritedConfigForConte

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);
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@

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;

/**
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
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}.
Original file line number Diff line number Diff line change
@@ -23,8 +23,8 @@

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}.
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
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}.
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@
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}.
Original file line number Diff line number Diff line change
@@ -27,8 +27,8 @@
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}.
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
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}.
Original file line number Diff line number Diff line change
@@ -30,8 +30,8 @@
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}.
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@
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;

/**
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
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}.
Original file line number Diff line number Diff line change
@@ -28,8 +28,8 @@
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}.
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
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.