1 package com.fasterxml.jackson.failing; 2 3 import com.fasterxml.jackson.annotation.*; 4 5 import com.fasterxml.jackson.databind.*; 6 7 public class EnumDeserialization2787Test extends BaseMapTest 8 { 9 // [databind#2787] 10 static enum SomeEnum2787 { 11 none, 12 tax10, 13 tax20 14 } 15 16 static enum SomeEnumMixin2787 { 17 @JsonProperty("zero") 18 none, 19 @JsonProperty("TypTyp") 20 tax10, 21 @JsonProperty("PytPyt") 22 tax20 23 } 24 25 /* 26 /********************************************************** 27 /* Test methods 28 /********************************************************** 29 */ 30 31 protected final ObjectMapper MAPPER = newJsonMapper(); 32 33 // [databind#2787] testMixinOnEnumValues2787()34 public void testMixinOnEnumValues2787() throws Exception 35 { 36 ObjectMapper mapper = jsonMapperBuilder() 37 .addMixIn(SomeEnum2787.class, SomeEnumMixin2787.class) 38 .build(); 39 SomeEnum2787 result = mapper.readValue(quote("zero"), SomeEnum2787.class); 40 assertEquals(SomeEnum2787.none, result); 41 } 42 } 43