Skip to content

Commit

Permalink
Change the RuntimeTypeAdapterFactoryTest, so it fails because of #712
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Oster committed Jun 28, 2022
1 parent 2d01d6a commit c79b6e3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public void testRuntimeTypeAdapter() {

CreditCard original = new CreditCard("Jesse", 234);
assertEquals("{\"type\":\"CreditCard\",\"cvv\":234,\"ownerName\":\"Jesse\"}",
gson.toJson(original, BillingInstrument.class));
//do not give the explicit typeOfSrc, because if this would be in a list
//or an attribute, there would also be no hint. See #712
gson.toJson(original));
BillingInstrument deserialized = gson.fromJson(
"{type:'CreditCard',cvv:234,ownerName:'Jesse'}", BillingInstrument.class);
assertEquals("Jesse", deserialized.ownerName);
Expand Down

0 comments on commit c79b6e3

Please sign in to comment.