aboutsummaryrefslogtreecommitdiff
path: root/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/guava-tests/test/com/google/common/reflect/ReflectionTest.java')
-rw-r--r--android/guava-tests/test/com/google/common/reflect/ReflectionTest.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java b/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java
index 2885f8956..83d0168a6 100644
--- a/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java
+++ b/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java
@@ -16,6 +16,8 @@
package com.google.common.reflect;
+import static org.junit.Assert.assertThrows;
+
import com.google.common.testing.NullPointerTester;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
@@ -39,11 +41,8 @@ public class ReflectionTest extends TestCase {
}
public void testNewProxyCantWorkOnAClass() throws Exception {
- try {
- Reflection.newProxy(Object.class, X_RETURNER);
- fail();
- } catch (IllegalArgumentException expected) {
- }
+ assertThrows(
+ IllegalArgumentException.class, () -> Reflection.newProxy(Object.class, X_RETURNER));
}
private static final InvocationHandler X_RETURNER =