class Animal { }
class Cat extends Animal { }
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({@JsonSubTypes.Type(value = Cat.class, name = "cat")})
abstract class SubTypesMixin { }
@Test
public void mixinsShouldWorkWithSubtypesAnnotations() throws IOException {
// given
String json = "{\"type\":\"cat\"}";
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.addMixIn(Animal.class, SubTypesMixin.class);
// when
Animal animal = new ObjectMapper()
.readerFor(Animal.class)
.readValue(json);
// then
assertEquals(animal.getClass(), Cat.class);
}