Skip to content

Commit ee8ce17

Browse files
committed
Merge branch '2.11'
2 parents 34de198 + 7c7b5c9 commit ee8ce17

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

src/test/java/com/fasterxml/jackson/databind/ser/TestSerializationOrder.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
public class TestSerializationOrder
1212
extends BaseMapTest
1313
{
14-
/*
15-
/**********************************************************
16-
/* Annotated helper classes
17-
/**********************************************************
18-
*/
19-
2014
static class BeanWithCreator
2115
{
2216
public int a;
@@ -33,7 +27,7 @@ static class BeanWithCreator
3327
static class BeanWithOrder
3428
{
3529
public int d, b, a, c;
36-
30+
3731
public BeanWithOrder(int a, int b, int c, int d) {
3832
this.a = a;
3933
this.b = b;
@@ -59,10 +53,10 @@ static class OrderMixIn { }
5953

6054
@JsonPropertyOrder(value={"a","b","x","z"})
6155
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"; }
6660
}
6761

6862
static class BeanFor459 {
@@ -72,7 +66,7 @@ static class BeanFor459 {
7266
public int a = 1;
7367
}
7468

75-
// For [Issue#311]
69+
// For [databind#311]
7670
@JsonPropertyOrder(alphabetic = true)
7771
public class BeanForGH311 {
7872
private final int a;
@@ -87,14 +81,14 @@ public BeanForGH311(@JsonProperty("b") int b, @JsonProperty("a") int a) { //b an
8781
public int getA() { return a; }
8882
public int getB() { return b; }
8983
}
90-
84+
9185
/*
9286
/*********************************************
9387
/* Unit tests
9488
/*********************************************
9589
*/
9690

97-
private final ObjectMapper MAPPER = objectMapper();
91+
private final ObjectMapper MAPPER = newJsonMapper();
9892

9993
public void testImplicitOrderByCreator() throws Exception
10094
{
@@ -111,7 +105,6 @@ public void testAlphabeticOrder() throws Exception
111105
assertEquals("{\"d\":4,\"a\":1,\"b\":2,\"c\":3}", MAPPER.writeValueAsString(new SubBeanWithOrder(1, 2, 3, 4)));
112106
}
113107

114-
115108
public void testOrderWithMixins() throws Exception
116109
{
117110
ObjectMapper mapper = jsonMapperBuilder()
@@ -136,6 +129,7 @@ public void testOrderWithFeature() throws Exception
136129
mapper.writeValueAsString(new BeanFor459()));
137130
}
138131

132+
// [databind#311]
139133
public void testAlphaAndCreatorOrdering() throws Exception
140134
{
141135
ObjectMapper mapper = jsonMapperBuilder()

0 commit comments

Comments
 (0)