Skip to content

Commit

Permalink
[Java] add JSONTest fro RequiredNullableBody class
Browse files Browse the repository at this point in the history
  • Loading branch information
fanqiewanzi committed Jun 1, 2024
1 parent ee239bf commit 0de51eb
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,13 @@ public void testOneOfAnyOfArray() throws Exception {
assertTrue(exception.getMessage().contains("java.io.IOException: The JSON string is invalid for"));
}
}

@Test
public void testRequiredNullableBody() throws Exception {
final String json1 = "{\"integer_prop\":null,\"number_prop\":null,\"boolean_prop\":null,\"string_prop\":null,\"date_prop\":null,\"datetime_prop\":null,\"array_nullable_prop\":null,\"array_and_items_nullable_prop\":null,\"array_items_nullable\":[],\"object_nullable_prop\":null,\"object_and_items_nullable_prop\":null,\"object_items_nullable\":{},\"custom_ref_enum\":null,\"custom_enum\":null}";
final RequiredNullableBody body = new RequiredNullableBody();

assertEquals("{\"array_items_nullable\":[],\"object_items_nullable\":{}}", json.serialize(body));
assertEquals(json.deserialize(json1, RequiredNullableBody.class), body);
}
}

0 comments on commit 0de51eb

Please sign in to comment.