-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
jr-record-test/src/test-jdk17/java/jr/failing/RecordDeser167Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |