-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
1 parent
d5cdd7b
commit 075ec92
Showing
4 changed files
with
93 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
33 changes: 33 additions & 0 deletions
33
src/test-jdk14/java/com/fasterxml/jackson/databind/records/RecordJsonValue3063Test.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,33 @@ | ||
package com.fasterxml.jackson.databind.records; | ||
|
||
import java.util.Collections; | ||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.annotation.*; | ||
|
||
import com.fasterxml.jackson.databind.BaseMapTest; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
public class RecordJsonValue3063Test extends BaseMapTest | ||
{ | ||
// [databind#3063] | ||
record GetLocations3063(@JsonValue Map<String, String> nameToLocation) | ||
{ | ||
@JsonCreator | ||
public GetLocations3063(Map<String, String> nameToLocation) | ||
{ | ||
this.nameToLocation = nameToLocation; | ||
} | ||
} | ||
|
||
private final ObjectMapper MAPPER = newJsonMapper(); | ||
|
||
// [databind#3063] | ||
public void testRecordWithJsonValue3063() throws Exception | ||
{ | ||
Map<String, String> locations = Collections.singletonMap("a", "locationA"); | ||
String json = MAPPER.writeValueAsString(new GetLocations3063(locations)); | ||
|
||
assertNotNull(json); | ||
} | ||
} |