Skip to content

Commit 9a2efef

Browse files
committed
Add failing test for #167
1 parent 81c6d1e commit 9a2efef

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package jr.failing;
2+
3+
import com.fasterxml.jackson.jr.ob.JSON;
4+
5+
import junit.framework.TestCase;
6+
7+
public class RecordDeser167Test extends TestCase
8+
{
9+
record FoundDependency(String id, String g, String a, String v, String timestamp) {}
10+
11+
// [jackson-jr#167]
12+
public void testRecordDeserOrder167() throws Exception
13+
{
14+
final String input = """
15+
{
16+
"id": "org.apache.maven:maven-core:3.9.8",
17+
"g": "org.apache.maven",
18+
"a": "maven-core",
19+
"v": "3.9.8",
20+
"p": "jar",
21+
"timestamp": 1718267050000,
22+
"ec": [
23+
"-cyclonedx.json",
24+
"-sources.jar",
25+
"-cyclonedx.xml",
26+
".pom",
27+
"-javadoc.jar",
28+
".jar"
29+
],
30+
"tags": [
31+
"core",
32+
"maven",
33+
"classes"
34+
]
35+
}
36+
""";
37+
final var expected = new FoundDependency("org.apache.maven:maven-core:3.9.8", "org.apache.maven", "maven-core", "3.9.8", "1718267050000");
38+
final var actual = JSON.std.beanFrom(FoundDependency.class, input);
39+
assertEquals(expected, actual);
40+
}
41+
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<artifactId>maven-surefire-plugin</artifactId>
8383
<configuration>
8484
<excludes>
85-
<exclude>com/fasterxml/jackson/**/failing/*.java</exclude>
85+
<exclude>**/failing/*.java</exclude>
8686
</excludes>
8787
</configuration>
8888
</plugin>

0 commit comments

Comments
 (0)