Skip to content

Commit

Permalink
Empty string audience claim should be deserialized as empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjames committed Jun 1, 2023
1 parent 923e9c4 commit 0a015cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -54,7 +54,7 @@ List<String> getStringOrArray(ObjectCodec codec, Map<String, JsonNode> tree, Str
if (node == null || node.isNull() || !(node.isArray() || node.isTextual())) {
return null;
}
if (node.isTextual() && !node.asText().isEmpty()) {
if (node.isTextual()) {
return Collections.singletonList(node.asText());
}

Expand Down
Expand Up @@ -145,14 +145,14 @@ public void shouldGetStringArrayWhenParsingTextNode() {
}

@Test
public void shouldGetEmptyStringArrayWhenParsingEmptyTextNode() {
public void shouldGetEmptyStringInArrayWhenParsingEmptyTextNode() {
Map<String, JsonNode> tree = new HashMap<>();
TextNode textNode = new TextNode("");
tree.put("key", textNode);

List<String> values = deserializer.getStringOrArray(objectMapper, tree, "key");
assertThat(values, is(notNullValue()));
assertThat(values, is(IsEmptyCollection.empty()));
assertThat(values, is(IsIterableContaining.hasItem("")));
}

@Test
Expand Down

0 comments on commit 0a015cc

Please sign in to comment.