-
-
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.
Fix #3906 by forcing Record constructors to be visible regardless of …
…overrides
- Loading branch information
1 parent
3140bb7
commit 6b441ed
Showing
2 changed files
with
27 additions
and
0 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
22 changes: 22 additions & 0 deletions
22
...st-jdk14/java/com/fasterxml/jackson/databind/records/RecordCreatorVisibility3906Test.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,22 @@ | ||
package com.fasterxml.jackson.databind.records; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | ||
import com.fasterxml.jackson.annotation.PropertyAccessor; | ||
import com.fasterxml.jackson.databind.*; | ||
|
||
// [databind#3906] | ||
public class RecordCreatorVisibility3906Test extends BaseMapTest | ||
{ | ||
// [databind#3906] | ||
record Record3906(String string, int integer) { } | ||
|
||
// [databind#3906] | ||
public void testRecordCreatorVisibility3906() throws Exception { | ||
ObjectMapper mapper = jsonMapperBuilder() | ||
.visibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE) | ||
.visibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY) | ||
.build(); | ||
Record3906 recordTest_deserialized = mapper.readValue("{}", Record3906.class); | ||
assertEquals(new Record3906(null, 0), recordTest_deserialized); | ||
} | ||
} |