mirror of
https://github.com/spring-projects/spring-security.git
synced 2026-03-25 11:31:05 +00:00
Test Jackson 2 deserializer with unknown obj/arr WebAuthn ext
Signed-off-by: Ziqin Wang <ziqin@wangziqin.net>
This commit is contained in:
parent
ef76ba040d
commit
88ea668f47
@ -122,6 +122,30 @@ class JacksonTests {
|
||||
assertThat(outputs).usingRecursiveComparison().isEqualTo(credProps);
|
||||
}
|
||||
|
||||
@Test
|
||||
void readAuthenticationExtensionsClientOutputsWhenUnknownExtension() throws Exception {
|
||||
String json = """
|
||||
{
|
||||
"unknownObject1": {
|
||||
"key": "value"
|
||||
},
|
||||
"unknownArray": [
|
||||
{ "key": "value1" },
|
||||
{ "key": "value2" }
|
||||
],
|
||||
"credProps": {
|
||||
"rk": false
|
||||
},
|
||||
"unknownObject2": {}
|
||||
}
|
||||
""";
|
||||
CredentialPropertiesOutput credProps = new CredentialPropertiesOutput(false);
|
||||
|
||||
AuthenticationExtensionsClientOutputs outputs = this.mapper.readValue(json,
|
||||
AuthenticationExtensionsClientOutputs.class);
|
||||
assertThat(outputs.getOutputs()).usingRecursiveFieldByFieldElementComparator().contains(credProps);
|
||||
}
|
||||
|
||||
@Test
|
||||
void readAuthenticationExtensionsClientOutputsWhenFieldAfter() throws Exception {
|
||||
String json = """
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user