Skip to content

Commit

Permalink
Add failing test for #167
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 9, 2024
1 parent 81c6d1e commit 9a2efef
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package jr.failing;

import com.fasterxml.jackson.jr.ob.JSON;

import junit.framework.TestCase;

public class RecordDeser167Test extends TestCase
{
record FoundDependency(String id, String g, String a, String v, String timestamp) {}

// [jackson-jr#167]
public void testRecordDeserOrder167() throws Exception
{
final String input = """
{
"id": "org.apache.maven:maven-core:3.9.8",
"g": "org.apache.maven",
"a": "maven-core",
"v": "3.9.8",
"p": "jar",
"timestamp": 1718267050000,
"ec": [
"-cyclonedx.json",
"-sources.jar",
"-cyclonedx.xml",
".pom",
"-javadoc.jar",
".jar"
],
"tags": [
"core",
"maven",
"classes"
]
}
""";
final var expected = new FoundDependency("org.apache.maven:maven-core:3.9.8", "org.apache.maven", "maven-core", "3.9.8", "1718267050000");
final var actual = JSON.std.beanFrom(FoundDependency.class, input);
assertEquals(expected, actual);
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>com/fasterxml/jackson/**/failing/*.java</exclude>
<exclude>**/failing/*.java</exclude>
</excludes>
</configuration>
</plugin>
Expand Down

0 comments on commit 9a2efef

Please sign in to comment.