testFramework: (testing) Fix type parameters in assertThrows()

Follows-up: IDEA-CR-18741 testFramework: (testing) Add UsefulTestCase.assertThrows()
This commit is contained in:
Eldar Abusalimov
2017-03-01 14:01:00 +03:00
parent 2e4b69cbdf
commit cd322c56a0
@@ -879,7 +879,7 @@ public abstract class UsefulTestCase extends TestCase {
* @param exceptionClass Expected exception type
* @param runnable Block annotated with some exception type
*/
protected <T extends Throwable> void assertThrows(@NotNull Class<? extends T> exceptionClass,
protected <T extends Throwable> void assertThrows(@NotNull Class<? extends Throwable> exceptionClass,
@NotNull ThrowableRunnable<T> runnable) throws T {
assertThrows(exceptionClass, null, runnable);
}
@@ -893,7 +893,7 @@ public abstract class UsefulTestCase extends TestCase {
* @param runnable Block annotated with some exception type
*/
@SuppressWarnings({"unchecked", "SameParameterValue"})
protected <T extends Throwable> void assertThrows(@NotNull Class<?> exceptionClass, @Nullable String expectedErrorMsg,
protected <T extends Throwable> void assertThrows(@NotNull Class<? extends Throwable> exceptionClass, @Nullable String expectedErrorMsg,
@NotNull ThrowableRunnable<T> runnable) throws T {
assertExceptionOccurred(true, new AbstractExceptionCase() {
@Override