11
11
import org .baeldung .jackson .dtos .withEnum .TypeEnumSimple ;
12
12
import org .baeldung .jackson .dtos .withEnum .TypeEnumWithCustomSerializer ;
13
13
import org .baeldung .jackson .dtos .withEnum .TypeEnumWithValue ;
14
- import org .junit .Ignore ;
15
14
import org .junit .Test ;
16
15
17
16
import com .fasterxml .jackson .core .JsonParseException ;
@@ -24,7 +23,7 @@ public class JacksonSerializationEnumsUnitTest {
24
23
@ Test
25
24
public final void whenSerializingASimpleEnum_thenCorrect () throws JsonParseException , IOException {
26
25
final ObjectMapper mapper = new ObjectMapper ();
27
- final String dtoAsString = mapper .writeValueAsString (TypeEnumSimple .TYPE1 . name () );
26
+ final String dtoAsString = mapper .writeValueAsString (TypeEnumSimple .TYPE1 );
28
27
System .out .println (dtoAsString );
29
28
30
29
assertThat (dtoAsString , containsString ("TYPE1" ));
@@ -33,10 +32,10 @@ public final void whenSerializingASimpleEnum_thenCorrect() throws JsonParseExcep
33
32
// tests - enum with main value
34
33
35
34
@ Test
36
- @ Ignore ("https://github.com/FasterXML/jackson-databind/issues/47" )
35
+ // @Ignore("https://github.com/FasterXML/jackson-databind/issues/47")
37
36
public final void whenSerializingAEnumWithValue_thenCorrect () throws JsonParseException , IOException {
38
37
final ObjectMapper mapper = new ObjectMapper ();
39
- final String dtoAsString = mapper .writeValueAsString (TypeEnumWithValue .TYPE1 . name () );
38
+ final String dtoAsString = mapper .writeValueAsString (TypeEnumWithValue .TYPE1 );
40
39
System .out .println (dtoAsString );
41
40
42
41
assertThat (dtoAsString , containsString ("Type A" ));
@@ -47,7 +46,7 @@ public final void whenSerializingAEnumWithValue_thenCorrect() throws JsonParseEx
47
46
@ Test
48
47
public final void whenSerializingAnEnum_thenCorrect () throws JsonParseException , IOException {
49
48
final ObjectMapper mapper = new ObjectMapper ();
50
- final String dtoAsString = mapper .writeValueAsString (TypeEnum .TYPE1 . name () );
49
+ final String dtoAsString = mapper .writeValueAsString (TypeEnum .TYPE1 );
51
50
52
51
System .out .println (dtoAsString );
53
52
assertThat (dtoAsString , containsString ("\" name\" :\" Type A\" " ));
0 commit comments