11
11
public class TestSerializationOrder
12
12
extends BaseMapTest
13
13
{
14
- /*
15
- /**********************************************************
16
- /* Annotated helper classes
17
- /**********************************************************
18
- */
19
-
20
14
static class BeanWithCreator
21
15
{
22
16
public int a ;
@@ -33,7 +27,7 @@ static class BeanWithCreator
33
27
static class BeanWithOrder
34
28
{
35
29
public int d , b , a , c ;
36
-
30
+
37
31
public BeanWithOrder (int a , int b , int c , int d ) {
38
32
this .a = a ;
39
33
this .b = b ;
@@ -59,10 +53,10 @@ static class OrderMixIn { }
59
53
60
54
@ JsonPropertyOrder (value ={"a" ,"b" ,"x" ,"z" })
61
55
static class BeanFor268 {
62
- @ JsonProperty ("a" ) public String xA = "a" ;
63
- @ JsonProperty ("z" ) public String aZ = "z" ;
64
- @ JsonProperty ("b" ) public String xB () { return "b" ; }
65
- @ JsonProperty ("x" ) public String aX () { return "x" ; }
56
+ @ JsonProperty ("a" ) public String xA = "a" ;
57
+ @ JsonProperty ("z" ) public String aZ = "z" ;
58
+ @ JsonProperty ("b" ) public String xB () { return "b" ; }
59
+ @ JsonProperty ("x" ) public String aX () { return "x" ; }
66
60
}
67
61
68
62
static class BeanFor459 {
@@ -72,7 +66,7 @@ static class BeanFor459 {
72
66
public int a = 1 ;
73
67
}
74
68
75
- // For [Issue #311]
69
+ // For [databind #311]
76
70
@ JsonPropertyOrder (alphabetic = true )
77
71
public class BeanForGH311 {
78
72
private final int a ;
@@ -87,16 +81,15 @@ public BeanForGH311(@JsonProperty("b") int b, @JsonProperty("a") int a) { //b an
87
81
public int getA () { return a ; }
88
82
public int getB () { return b ; }
89
83
}
90
-
84
+
91
85
/*
92
86
/*********************************************
93
87
/* Unit tests
94
88
/*********************************************
95
89
*/
96
90
97
- final ObjectMapper MAPPER = new ObjectMapper ();
98
-
99
- // Test for [JACKSON-170]
91
+ private final ObjectMapper MAPPER = newJsonMapper ();
92
+
100
93
public void testImplicitOrderByCreator () throws Exception
101
94
{
102
95
assertEquals ("{\" c\" :1,\" a\" :2,\" b\" :0}" , MAPPER .writeValueAsString (new BeanWithCreator (1 , 2 )));
@@ -112,7 +105,6 @@ public void testAlphabeticOrder() throws Exception
112
105
assertEquals ("{\" d\" :4,\" a\" :1,\" b\" :2,\" c\" :3}" , MAPPER .writeValueAsString (new SubBeanWithOrder (1 , 2 , 3 , 4 )));
113
106
}
114
107
115
-
116
108
public void testOrderWithMixins () throws Exception
117
109
{
118
110
ObjectMapper m = jsonMapperBuilder ()
@@ -137,8 +129,7 @@ public void testOrderWithFeature() throws Exception
137
129
m .writeValueAsString (new BeanFor459 ()));
138
130
}
139
131
140
- // [Issue#311]
141
-
132
+ // [databind#311]
142
133
public void testAlphaAndCreatorOrdering () throws Exception
143
134
{
144
135
ObjectMapper m = jsonMapperBuilder ()
0 commit comments