1111import org .baeldung .jackson .dtos .withEnum .TypeEnumSimple ;
1212import org .baeldung .jackson .dtos .withEnum .TypeEnumWithCustomSerializer ;
1313import org .baeldung .jackson .dtos .withEnum .TypeEnumWithValue ;
14- import org .junit .Ignore ;
1514import org .junit .Test ;
1615
1716import com .fasterxml .jackson .core .JsonParseException ;
@@ -24,7 +23,7 @@ public class JacksonSerializationEnumsUnitTest {
2423 @ Test
2524 public final void whenSerializingASimpleEnum_thenCorrect () throws JsonParseException , IOException {
2625 final ObjectMapper mapper = new ObjectMapper ();
27- final String dtoAsString = mapper .writeValueAsString (TypeEnumSimple .TYPE1 . name () );
26+ final String dtoAsString = mapper .writeValueAsString (TypeEnumSimple .TYPE1 );
2827 System .out .println (dtoAsString );
2928
3029 assertThat (dtoAsString , containsString ("TYPE1" ));
@@ -33,10 +32,10 @@ public final void whenSerializingASimpleEnum_thenCorrect() throws JsonParseExcep
3332 // tests - enum with main value
3433
3534 @ Test
36- @ Ignore ("https://github.com/FasterXML/jackson-databind/issues/47" )
35+ // @Ignore("https://github.com/FasterXML/jackson-databind/issues/47")
3736 public final void whenSerializingAEnumWithValue_thenCorrect () throws JsonParseException , IOException {
3837 final ObjectMapper mapper = new ObjectMapper ();
39- final String dtoAsString = mapper .writeValueAsString (TypeEnumWithValue .TYPE1 . name () );
38+ final String dtoAsString = mapper .writeValueAsString (TypeEnumWithValue .TYPE1 );
4039 System .out .println (dtoAsString );
4140
4241 assertThat (dtoAsString , containsString ("Type A" ));
@@ -47,7 +46,7 @@ public final void whenSerializingAEnumWithValue_thenCorrect() throws JsonParseEx
4746 @ Test
4847 public final void whenSerializingAnEnum_thenCorrect () throws JsonParseException , IOException {
4948 final ObjectMapper mapper = new ObjectMapper ();
50- final String dtoAsString = mapper .writeValueAsString (TypeEnum .TYPE1 . name () );
49+ final String dtoAsString = mapper .writeValueAsString (TypeEnum .TYPE1 );
5150
5251 System .out .println (dtoAsString );
5352 assertThat (dtoAsString , containsString ("\" name\" :\" Type A\" " ));
0 commit comments