Skip to content

Commit 4bcc597

Browse files
carterkozakbulldozer-bot[bot]
authored andcommitted
Annotate test-utils AssertJ Assertions with CheckReturnValue (#407)
Annotate test-utils AssertJ Assertions with CheckReturnValue to match assertj-core.
1 parent dfe266f commit 4bcc597

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: fix
2+
fix:
3+
description: Annotate test-utils AssertJ Assertions with CheckReturnValue to match
4+
assertj-core.
5+
links:
6+
- https://github.com/palantir/conjure-java-runtime-api/pull/407

test-utils/src/main/java/com/palantir/conjure/java/api/testing/Assertions.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
import org.assertj.core.api.AssertionsForClassTypes;
2222
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
2323
import org.assertj.core.internal.Failures;
24+
import org.assertj.core.util.CanIgnoreReturnValue;
25+
import org.assertj.core.util.CheckReturnValue;
2426

27+
@CheckReturnValue
2528
public class Assertions extends org.assertj.core.api.Assertions {
2629

2730
Assertions() {}
@@ -34,12 +37,14 @@ public static RemoteExceptionAssert assertThat(RemoteException actual) {
3437
return new RemoteExceptionAssert(actual);
3538
}
3639

40+
@CanIgnoreReturnValue
3741
public static ServiceExceptionAssert assertThatServiceExceptionThrownBy(ThrowingCallable shouldRaiseThrowable) {
3842
Throwable throwable = AssertionsForClassTypes.catchThrowable(shouldRaiseThrowable);
3943
checkThrowableIsOfType(throwable, ServiceException.class);
4044
return new ServiceExceptionAssert((ServiceException) throwable);
4145
}
4246

47+
@CanIgnoreReturnValue
4348
public static RemoteExceptionAssert assertThatRemoteExceptionThrownBy(ThrowingCallable shouldRaiseThrowable) {
4449
Throwable throwable = AssertionsForClassTypes.catchThrowable(shouldRaiseThrowable);
4550
checkThrowableIsOfType(throwable, RemoteException.class);

0 commit comments

Comments
 (0)