-
-
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
4675896
commit a1404d5
Showing
5 changed files
with
64 additions
and
15 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
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
41 changes: 41 additions & 0 deletions
41
src/test/java/com/fasterxml/jackson/databind/creators/DelegatingArrayCreator1804Test.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 com.fasterxml.jackson.databind.creators; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import com.fasterxml.jackson.databind.BaseMapTest; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
public class DelegatingArrayCreator1804Test extends BaseMapTest | ||
{ | ||
public static class MyTypeImpl extends MyType { | ||
private final List<Integer> values; | ||
|
||
MyTypeImpl(List<Integer> values) { | ||
this.values = values; | ||
} | ||
|
||
@Override | ||
public List<Integer> getValues() { | ||
return values; | ||
} | ||
} | ||
|
||
static abstract class MyType { | ||
@JsonValue | ||
public abstract List<Integer> getValues(); | ||
|
||
@JsonCreator(mode=JsonCreator.Mode.DELEGATING) | ||
public static MyType of(List<Integer> values) { | ||
return new MyTypeImpl(values); | ||
} | ||
} | ||
|
||
|
||
public void testDelegatingArray1804() throws Exception { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
MyType thing = mapper.readValue("[]", MyType.class); | ||
assertNotNull(thing); | ||
} | ||
} |