Skip to content

Commit 9df530d

Browse files
committed
Revert "[Breaking change] Align return types across assertions / assumptions / soft assertions and do not use Abstract Asserts"
This reverts commit cfbb302 (#2173) due to the heavy impact on binary compatibility and to continue allowing third-party libraries returning their own assertion classes with overridden `assertThat` methods.
1 parent e3d9e07 commit 9df530d

21 files changed

+687
-681
lines changed

src/main/java/org/assertj/core/api/Assertions.java

+65-65
Large diffs are not rendered by default.

src/main/java/org/assertj/core/api/AssertionsForClassTypes.java

+56-56
Large diffs are not rendered by default.

src/main/java/org/assertj/core/api/AssertionsForInterfaceTypes.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected AssertionsForInterfaceTypes() {}
9292
* @param actual the actual value.
9393
* @return the created assertion object.
9494
*/
95-
public static CharSequenceAssert assertThat(CharSequence actual) {
95+
public static AbstractCharSequenceAssert<?, ? extends CharSequence> assertThat(CharSequence actual) {
9696
return new CharSequenceAssert(actual);
9797
}
9898

@@ -296,7 +296,7 @@ ClassBasedNavigableListAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> assertThat(Lis
296296
* @param actual the path to test
297297
* @return the created assertion object
298298
*/
299-
public static PathAssert assertThat(Path actual) {
299+
public static AbstractPathAssert<?> assertThat(Path actual) {
300300
return new PathAssert(actual);
301301
}
302302

@@ -323,7 +323,7 @@ public static <K, V> MapAssert<K, V> assertThat(Map<K, V> actual) {
323323
* @param actual the actual value.
324324
* @return the created assertion object.
325325
*/
326-
public static <T extends Comparable<? super T>> GenericComparableAssert<T> assertThat(T actual) {
326+
public static <T extends Comparable<? super T>> AbstractComparableAssert<?, T> assertThat(T actual) {
327327
return new GenericComparableAssert<>(actual);
328328
}
329329

src/main/java/org/assertj/core/api/Assumptions.java

+56-56
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)