Skip to content

Commit

Permalink
Update gson/src/test/java/com/google/gson/GsonBuilderTest.java
Browse files Browse the repository at this point in the history
Co-authored-by: Marcono1234 <[email protected]>
  • Loading branch information
sachinp97 and Marcono1234 authored Sep 29, 2023
1 parent d853261 commit d9025c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gson/src/test/java/com/google/gson/GsonBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,14 @@ public void testSetStrictness() throws IOException {
public void testRegisterTypeAdapterForObjectAndJsonElements() {
final String ERROR_MESSAGE = "Cannot override built-in adapter for ";
Type[] types = {
Object.class,
JsonElement.class,
JsonArray.class,
Object.class,
JsonElement.class,
JsonArray.class,
};
GsonBuilder gsonBuilder = new GsonBuilder();
for (Type type : types) {
IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
() -> gsonBuilder.registerTypeAdapter(type, NULL_TYPE_ADAPTER));
() -> gsonBuilder.registerTypeAdapter(type, NULL_TYPE_ADAPTER));
assertThat(e).hasMessageThat().isEqualTo(ERROR_MESSAGE + type);
}
}
Expand Down

0 comments on commit d9025c8

Please sign in to comment.