Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rockoder committed Mar 10, 2019
1 parent 2133494 commit ef94015
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void givenPolymorphicList_whenDeserializeWithTypeAdapter_thenCorrect() {

assertEquals(2, outList.size());
assertTrue(outList.get(0) instanceof Dog);
assertTrue(outList.get(1) instanceof Cow);
}

@Test
Expand All @@ -101,7 +102,7 @@ public void givenPolymorphicList_whenDeserializeWithRuntimeTypeAdapter_thenCorre

Type listOfAnimals = new TypeToken<ArrayList<Animal>>() {}.getType();

RuntimeTypeAdapterFactory<Animal> adapter = RuntimeTypeAdapterFactory.of(Animal.class)
RuntimeTypeAdapterFactory<Animal> adapter = RuntimeTypeAdapterFactory.of(Animal.class, "type")
.registerSubtype(Dog.class)
.registerSubtype(Cow.class);

Expand All @@ -111,5 +112,6 @@ public void givenPolymorphicList_whenDeserializeWithRuntimeTypeAdapter_thenCorre

assertEquals(2, outList.size());
assertTrue(outList.get(0) instanceof Dog);
assertTrue(outList.get(1) instanceof Cow);
}
}

0 comments on commit ef94015

Please sign in to comment.