Skip to content

Commit

Permalink
Add test that only requesting adapter does not throw
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcono1234 committed Jul 26, 2023
1 parent ac57016 commit 51f4a76
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public class JsonOrgInteropTest {
@Test
public void testNoCustomAdapter() {
Gson gson = new Gson();

// Merely requesting the adapter should not throw an exception
assertThat(gson.getAdapter(JSONArray.class)).isNotNull();
assertThat(gson.getAdapter(JSONObject.class)).isNotNull();

String expectedMessageArray = "Unsupported class from other JSON library: org.json.JSONArray"
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#unsupported-json-library-class";
String expectedMessageObject = "Unsupported class from other JSON library: org.json.JSONObject"
Expand Down

0 comments on commit 51f4a76

Please sign in to comment.