diff --git a/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java b/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java index e2c2b02e..f81537f5 100644 --- a/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java +++ b/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java @@ -90,7 +90,9 @@ public class DefaultTypeAdaptersTest extends TestCase { public void testClassSerialization() { try { gson.toJson(String.class); - } catch (UnsupportedOperationException expected) {} + fail(); + } catch (UnsupportedOperationException expected) { + } // Override with a custom type adapter for class. gson = new GsonBuilder().registerTypeAdapter(Class.class, new MyClassTypeAdapter()).create(); assertEquals("\"java.lang.String\"", gson.toJson(String.class)); @@ -99,7 +101,9 @@ public class DefaultTypeAdaptersTest extends TestCase { public void testClassDeserialization() { try { gson.fromJson("String.class", String.class.getClass()); - } catch (UnsupportedOperationException expected) {} + fail(); + } catch (UnsupportedOperationException expected) { + } // Override with a custom type adapter for class. gson = new GsonBuilder().registerTypeAdapter(Class.class, new MyClassTypeAdapter()).create(); assertEquals(String.class, gson.fromJson("java.lang.String", Class.class));