Skip to content

Commit d07ed0b

Browse files
jokaahkcooney
authored andcommitted
Made ExpectedExceptio.isAnyExceptionExpected public. (#1443)
1 parent 7c94e33 commit d07ed0b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/org/junit/rules/ExpectedException.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ public ExpectedException expectCause(Matcher<?> expectedCause) {
245245
return this;
246246
}
247247

248+
/**
249+
* Check if any Exception is expected.
250+
* @since 4.13
251+
*/
252+
public final boolean isAnyExceptionExpected() {
253+
return matcherBuilder.expectsThrowable();
254+
}
255+
248256
private class ExpectedExceptionStatement extends Statement {
249257
private final Statement next;
250258

@@ -274,10 +282,6 @@ private void handleException(Throwable e) throws Throwable {
274282
}
275283
}
276284

277-
private boolean isAnyExceptionExpected() {
278-
return matcherBuilder.expectsThrowable();
279-
}
280-
281285
private void failDueToMissingException() throws AssertionError {
282286
fail(missingExceptionMessage());
283287
}

0 commit comments

Comments
 (0)