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.
Fix #38 (requires jackson-databind 2.3.1)
- Loading branch information
1 parent
2305af8
commit e807494
Showing
5 changed files
with
38 additions
and
8 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
31 changes: 31 additions & 0 deletions
31
src/test/java/com/fasterxml/jackson/module/afterburner/ser/TestRawValues.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,31 @@ | ||
package com.fasterxml.jackson.module.afterburner.ser; | ||
|
||
import com.fasterxml.jackson.annotation.JsonRawValue; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.module.afterburner.AfterburnerTestBase; | ||
|
||
public class TestRawValues extends AfterburnerTestBase | ||
{ | ||
static class SerializableObject | ||
{ | ||
public SerializableObject(String v) { value = v; } | ||
|
||
@JsonRawValue | ||
public String value; | ||
} | ||
|
||
/* | ||
/********************************************************** | ||
/* Unit tests | ||
/********************************************************** | ||
*/ | ||
|
||
private final ObjectMapper MAPPER = mapperWithModule(); | ||
|
||
public void testAfterBurner() throws Exception | ||
{ | ||
SerializableObject so = new SerializableObject("[123]"); | ||
|
||
assertEquals("{\"value\":[123]}", MAPPER.writeValueAsString(so)); | ||
} | ||
} |