Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed support for deserialization from Base64 into a byte array. (#7236)
- Loading branch information
1 parent
a612e4a
commit 9fa427c
Showing
2 changed files
with
38 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
27 changes: 27 additions & 0 deletions
27
...n-core/src/test/groovy/io/micronaut/jackson/core/tree/JsonNodeTraversingParserTest.groovy
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,27 @@ | ||
package io.micronaut.jackson.core.tree | ||
|
||
import com.fasterxml.jackson.core.Base64Variant | ||
import com.fasterxml.jackson.core.Base64Variants | ||
import io.micronaut.json.tree.JsonNode | ||
import spock.lang.Specification | ||
|
||
class JsonNodeTraversingParserTest extends Specification { | ||
|
||
def getBinaryValue() { | ||
given: | ||
def parser = new JsonNodeTraversingParser(jsonNode) | ||
|
||
parser.nextToken() | ||
|
||
def binaryValue = parser.getBinaryValue(Base64Variants.MIME) | ||
|
||
expect: | ||
binaryValue == expected?.bytes | ||
|
||
where: | ||
jsonNode || expected | ||
JsonNode.createStringNode("YWJj") || "abc" | ||
JsonNode.nullNode() || null | ||
} | ||
|
||
} |