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
t-oster committed Jun 28, 2022
1 parent 2d01d6a commit ca4b28c
Showing 1 changed file with 3 additions and 1 deletion.
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 ca4b28c

Please sign in to comment.