Skip to content

Commit 6ffa6e0

Browse files
authored
Move 4961 test out of tofix (#4965)
1 parent 2e30184 commit 6ffa6e0

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.databind.tofix;
1+
package com.fasterxml.jackson.databind.struct;
22

33
import java.util.Map;
44
import java.util.TreeMap;
@@ -8,7 +8,6 @@
88
import com.fasterxml.jackson.annotation.*;
99
import com.fasterxml.jackson.databind.ObjectMapper;
1010
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
11-
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;
1211

1312
import static org.junit.jupiter.api.Assertions.assertEquals;
1413

@@ -21,7 +20,6 @@ static class WrapperForAnyGetter {
2120
public BeanWithAnyGetter value;
2221
}
2322

24-
@JsonPropertyOrder({ "firstProperty", "secondProperties", "anyProperty", "forthProperty" })
2523
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
2624
static class BeanWithAnyGetter {
2725
public String firstProperty = "first";
@@ -38,47 +36,22 @@ public Map<String, String> getAnyProperty() {
3836

3937
final ObjectMapper MAPPER = newJsonMapper();
4038

41-
@JacksonTestFailureExpected
4239
@Test
4340
public void testSerializeArrayWithAnyGetterWithWrapper() throws Exception {
4441
WrapperForAnyGetter wrapper = new WrapperForAnyGetter();
4542
wrapper.value = new BeanWithAnyGetter();
4643

4744
String json = MAPPER.writeValueAsString(wrapper);
4845

49-
// In 2.19, Fails Actual
50-
// : {"value":{"firstProperty":"first","secondProperties":"second","forthProperty":"forth","third_A":"third_A","third_B":"third_B"}}
51-
// Getting better, after #4775 in 2.19, fails Actual
52-
// : {"value":["first","second",{"third_A":"third_A","third_B":"third_B"},"forth"]}
53-
assertEquals(a2q("{'value':" +
54-
"[" +
55-
"'first'," +
56-
"'second'," +
57-
"'forth'," +
58-
"'third_A'," +
59-
"'third_B'" +
60-
"]" +
61-
"}"), json);
46+
assertEquals(a2q("{\"value\":[\"first\",\"second\",\"forth\",{\"third_A\":\"third_A\",\"third_B\":\"third_B\"}]}"), json);
6247
}
6348

64-
@JacksonTestFailureExpected
6549
@Test
6650
public void testSerializeArrayWithAnyGetterAsRoot() throws Exception {
6751
BeanWithAnyGetter bean = new BeanWithAnyGetter();
6852

6953
String json = MAPPER.writeValueAsString(bean);
7054

71-
// In 2.19, Fails Actual
72-
// : {"firstProperty":"first","secondProperties":"second","forthProperty":"forth","third_A":"third_A","third_B":"third_B"}
73-
74-
// Getting better, after #4775 in 2.19, fails Actual
75-
// : ["first","second",{"third_A":"third_A","third_B":"third_B"},"forth"]
76-
assertEquals(a2q("[" +
77-
"'first'," +
78-
"'second'," +
79-
"'forth'," +
80-
"'third_A'," +
81-
"'third_B'" +
82-
"]"), json);
55+
assertEquals(a2q("[\"first\",\"second\",\"forth\",{\"third_A\":\"third_A\",\"third_B\":\"third_B\"}]"), json);
8356
}
8457
}

0 commit comments

Comments
 (0)