@@ -957,19 +957,17 @@ public static <T> void assertThat(String reason, T actual,
957
957
}
958
958
959
959
/**
960
- * This interface facilitates the use of expectThrows from Java 8. It allows
961
- * method references to void methods (that declare checked exceptions) to be
962
- * passed directly into expectThrows without wrapping. It is not meant to be
963
- * implemented directly.
960
+ * This interface facilitates the use of expectThrows from Java 8. It allows method references
961
+ * to void methods (that declare checked exceptions) to be passed directly into expectThrows
962
+ * without wrapping. It is not meant to be implemented directly.
964
963
*/
965
964
public interface ThrowingRunnable {
966
965
void run () throws Throwable ;
967
966
}
968
967
969
968
/**
970
- * Asserts that {@code runnable} throws an exception when executed. If it
971
- * does, the exception object is returned. If it does not, an
972
- * {@link AssertionError} is thrown.
969
+ * Asserts that {@code runnable} throws an exception when executed. If it does, the exception
970
+ * object is returned. If it does not, an {@link AssertionError} is thrown.
973
971
*
974
972
* @param runnable A function that is expected to throw an exception when executed
975
973
* @return The exception thrown by {@code runnable}
@@ -979,11 +977,11 @@ public static <T extends Throwable> T expectThrows(ThrowingRunnable runnable) {
979
977
}
980
978
981
979
/**
982
- * Asserts that {@code runnable} throws an exception when executed. If it
983
- * does, the exception object is returned. If it does not, an
984
- * {@link AssertionError} is thrown with the given {@code message}.
980
+ * Asserts that {@code runnable} throws an exception when executed. If it does, the exception
981
+ * object is returned. If it does not, an {@link AssertionError} is thrown with the given {@code
982
+ * message}.
985
983
*
986
- * @param message the identifying message for the {@link AssertionError}
984
+ * @param message the identifying message for the {@link AssertionError}
987
985
* @param runnable A function that is expected to throw an exception when executed
988
986
* @return The exception thrown by {@code runnable}
989
987
*/
@@ -992,11 +990,10 @@ public static <T extends Throwable> T expectThrows(String message, ThrowingRunna
992
990
}
993
991
994
992
/**
995
- * Asserts that {@code runnable} throws an exception of type
996
- * {@code throwableClass} when executed. If it does, the exception object
997
- * is returned. If it does not throw an exception, an {@link AssertionError}
998
- * is thrown. If it throws the wrong type of exception, an
999
- * {@code AssertionError} is thrown describing the mismatch.
993
+ * Asserts that {@code runnable} throws an exception of type {@code throwableClass} when
994
+ * executed. If it does, the exception object is returned. If it does not throw an exception, an
995
+ * {@link AssertionError} is thrown. If it throws the wrong type of exception, an {@code
996
+ * AssertionError} is thrown describing the mismatch.
1000
997
*
1001
998
* @param throwableClass the expected type of the exception
1002
999
* @param runnable A function that is expected to throw an exception when executed
@@ -1007,13 +1004,12 @@ public static <T extends Throwable> T expectThrows(Class<T> throwableClass, Thro
1007
1004
}
1008
1005
1009
1006
/**
1010
- * Asserts that {@code runnable} throws an exception of type
1011
- * {@code throwableClass} when executed. If it does, the exception object
1012
- * is returned. If it does not throw an exception, an {@link AssertionError}
1013
- * is thrown with the given {@code message}. If it throws the wrong type
1007
+ * Asserts that {@code runnable} throws an exception of type {@code throwableClass} when
1008
+ * executed. If it does, the exception object is returned. If it does not throw an exception, an
1009
+ * {@link AssertionError} is thrown with the given {@code message}. If it throws the wrong type
1014
1010
* of exception, an {@code AssertionError} is thrown describing the mismatch.
1015
1011
*
1016
- * @param message the identifying message for the {@link AssertionError}
1012
+ * @param message the identifying message for the {@link AssertionError}
1017
1013
* @param throwableClass the expected type of the exception
1018
1014
* @param runnable A function that is expected to throw an exception when executed
1019
1015
* @return The exception thrown by {@code runnable}
0 commit comments