-
Notifications
You must be signed in to change notification settings - Fork 81
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
dba6a41
commit 71d4c70
Showing
5 changed files
with
69 additions
and
6 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
24 changes: 24 additions & 0 deletions
24
...src/test/java/com/fasterxml/jackson/module/afterburner/misc/PreventJDKTypeAccessTest.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,24 @@ | ||
package com.fasterxml.jackson.module.afterburner.misc; | ||
|
||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.module.afterburner.AfterburnerTestBase; | ||
|
||
public class PreventJDKTypeAccessTest extends AfterburnerTestBase | ||
{ | ||
private final ObjectMapper MAPPER = newObjectMapper(); | ||
private final ObjectMapper VANILLA_MAPPER = newVanillaJSONMapper(); | ||
|
||
public void testJDKThreadroundTrip() throws Exception | ||
{ | ||
final Object input = Thread.currentThread(); | ||
final String json1 = VANILLA_MAPPER.writeValueAsString(input); | ||
final String json2 = MAPPER.writeValueAsString(input); | ||
|
||
Map<?,?> map1 = VANILLA_MAPPER.readValue(json1, Map.class); | ||
Map<?,?> map2 = MAPPER.readValue(json2, Map.class); | ||
|
||
assertEquals(map1.keySet(), map2.keySet()); | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
...d/src/test/java/com/fasterxml/jackson/module/blackbird/misc/PreventJDKTypeAccessTest.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,24 @@ | ||
package com.fasterxml.jackson.module.blackbird.misc; | ||
|
||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.module.blackbird.BlackbirdTestBase; | ||
|
||
public class PreventJDKTypeAccessTest extends BlackbirdTestBase | ||
{ | ||
private final ObjectMapper MAPPER = newObjectMapper(); | ||
private final ObjectMapper VANILLA_MAPPER = newVanillaJSONMapper(); | ||
|
||
public void testJDKThreadroundTrip() throws Exception | ||
{ | ||
final Object input = Thread.currentThread(); | ||
final String json1 = VANILLA_MAPPER.writeValueAsString(input); | ||
final String json2 = MAPPER.writeValueAsString(input); | ||
|
||
Map<?,?> map1 = VANILLA_MAPPER.readValue(json1, Map.class); | ||
Map<?,?> map2 = MAPPER.readValue(json2, Map.class); | ||
|
||
assertEquals(map1.keySet(), map2.keySet()); | ||
} | ||
} |
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