This repository has been archived by the owner on Nov 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
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
861cbc0
commit c213798
Showing
3 changed files
with
104 additions
and
66 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
39 changes: 39 additions & 0 deletions
39
src/test/java/com/fasterxml/jackson/module/afterburner/deser/TestSingleArgCtors.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,39 @@ | ||
package com.fasterxml.jackson.module.afterburner.deser; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.module.afterburner.AfterburnerTestBase; | ||
|
||
public class TestSingleArgCtors extends AfterburnerTestBase | ||
{ | ||
static class Node { | ||
public String name; | ||
|
||
public int value; | ||
|
||
public Node() { } | ||
|
||
@JsonCreator | ||
public Node(String n) { | ||
name = n; | ||
value = -1; | ||
} | ||
} | ||
|
||
/* | ||
/********************************************************** | ||
/* Test methods | ||
/********************************************************** | ||
*/ | ||
|
||
private final ObjectMapper MAPPER = mapperWithModule(); | ||
|
||
public void testSingleStringArgCtor() throws Exception | ||
{ | ||
Node bean = MAPPER.readValue(quote("Foobar"), Node.class); | ||
assertNotNull(bean); | ||
assertEquals(-1, bean.value); | ||
assertEquals("Foobar", bean.name); | ||
} | ||
|
||
} |