Skip to content

Commit 65bf54d

Browse files
committed
Test Jackson 3 deserializer with unknown primitive WebAuthn ext
Signed-off-by: Ziqin Wang <ziqin@wangziqin.net>
1 parent 7f75fd6 commit 65bf54d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • webauthn/src/test/java/org/springframework/security/web/webauthn/jackson

webauthn/src/test/java/org/springframework/security/web/webauthn/jackson/JacksonTests.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,23 @@ void readCredPropsWhenAuthenticatorDisplayName() throws Exception {
121121
assertThat(outputs).usingRecursiveComparison().isEqualTo(credProps);
122122
}
123123

124+
@Test
125+
void readAuthenticationExtensionsClientOutputsWhenAppId() {
126+
String json = """
127+
{
128+
"appid": false,
129+
"credProps": {
130+
"rk": false
131+
}
132+
}
133+
""";
134+
CredentialPropertiesOutput credProps = new CredentialPropertiesOutput(false);
135+
136+
AuthenticationExtensionsClientOutputs outputs = this.mapper.readValue(json,
137+
AuthenticationExtensionsClientOutputs.class);
138+
assertThat(outputs.getOutputs()).usingRecursiveFieldByFieldElementComparator().contains(credProps);
139+
}
140+
124141
@Test
125142
void readAuthenticationExtensionsClientOutputsWhenUnknownExtension() {
126143
String json = """

0 commit comments

Comments
 (0)