Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-costigliola committed Dec 13, 2015
1 parent 3371146 commit c6ac48a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/assertj/core/api/Assertions.java
Expand Up @@ -612,7 +612,7 @@ public static AbstractDateAssert<?> assertThat(Date actual) {
* @param shouldRaiseThrowable The {@link ThrowingCallable} or lambda with the code that should raise the throwable.
* @return The captured exception or <code>null</code> if none was raised by the callable.
*/
public static AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownBy(ThrowingCallable shouldRaiseThrowable) {
public static AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable) {
return new ThrowableAssert(catchThrowable(shouldRaiseThrowable)).hasBeenThrown();
}

Expand Down Expand Up @@ -656,7 +656,7 @@ public static AbstractDateAssert<?> assertThat(Date actual) {
* @param shouldRaiseThrowable The lambda with the code that should raise the exception.
* @return The captured exception or <code>null</code> if none was raised by the callable.
*/
public static Throwable catchThrowable(ThrowingCallable shouldRaiseThrowable) {
public static Throwable catchThrowable(ThrowableAssert.ThrowingCallable shouldRaiseThrowable) {
return ThrowableAssert.catchThrowable(shouldRaiseThrowable);
}

Expand Down
12 changes: 11 additions & 1 deletion src/main/java/org/assertj/core/api/Java6Assertions.java
Expand Up @@ -583,7 +583,17 @@ public static AbstractDateAssert<?> assertThat(Date actual) {
* }).isInstanceOf(Exception.class)
* .hasMessageContaining("boom");</code></pre>
*
* @param shouldRaiseThrowable The {@link ThrowableAssert.ThrowingCallable} or lambda with the code that should raise the throwable.
* If the provided {@link ThrowingCallable} does not raise an exception, an error is immediately raised,
* in that case the test description provided with {@link AbstractAssert#as(String, Object...) as(String, Object...)} is not honored.
* To use a test description, use {@link #catchThrowable(ThrowingCallable) catchThrowable} as shown below.
* <pre><code class='java'> // assertion will fail but "display me" won't appear in the error
* assertThatThrownBy(() -> { // do nothing }).as("display me").isInstanceOf(Exception.class);
*
* // assertion will fail AND "display me" will appear in the error
* Throwable thrown = catchThrowable(() -> { // do nothing });
* assertThat(thrown).as("display me").isInstanceOf(Exception.class); </code></pre>
*
* @param shouldRaiseThrowable The {@link ThrowingCallable} or lambda with the code that should raise the throwable.
* @return The captured exception or <code>null</code> if none was raised by the callable.
*/
public static AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable) {
Expand Down

0 comments on commit c6ac48a

Please sign in to comment.