Complete the automatable migration to assertThrows.

And update some attempted suppressions to make them actually work.

RELNOTES=n/a
PiperOrigin-RevId: 688267287
This commit is contained in:
cpovirk 2024-10-21 14:09:31 -07:00 committed by Google Java Core Libraries
parent 67f914985e
commit 3d14f1d81b
2 changed files with 4 additions and 4 deletions

View File

@ -65,7 +65,7 @@ public class TypeTokenTest extends TestCase {
assertEquals(a, b);
}
@SuppressWarnings("TestException") // see comment below
@SuppressWarnings("TestExceptionChecker") // see comment below
public <T> void testVariableTypeTokenNotAllowed() {
/*
* We'd use assertThrows here, but that causes no exception to be thrown under Java 8,
@ -1252,7 +1252,7 @@ public class TypeTokenTest extends TestCase {
assertThrows(IllegalArgumentException.class, () -> type.getSubtype(Iterable.class));
}
@SuppressWarnings("TestException") // see comment below
@SuppressWarnings("TestExceptionChecker") // see comment below
public <T extends Iterable<String>> void testGetSubtype_fromTypeVariable() {
/*
* We'd use assertThrows here, but that causes capture() to return null under Java 8, presumably

View File

@ -65,7 +65,7 @@ public class TypeTokenTest extends TestCase {
assertEquals(a, b);
}
@SuppressWarnings("TestException") // see comment below
@SuppressWarnings("TestExceptionChecker") // see comment below
public <T> void testVariableTypeTokenNotAllowed() {
/*
* We'd use assertThrows here, but that causes no exception to be thrown under Java 8,
@ -1252,7 +1252,7 @@ public class TypeTokenTest extends TestCase {
assertThrows(IllegalArgumentException.class, () -> type.getSubtype(Iterable.class));
}
@SuppressWarnings("TestException") // see comment below
@SuppressWarnings("TestExceptionChecker") // see comment below
public <T extends Iterable<String>> void testGetSubtype_fromTypeVariable() {
/*
* We'd use assertThrows here, but that causes capture() to return null under Java 8, presumably