use of com.webauthn4j.data.PublicKeyCredentialDescriptor in project webauthn4j-spring-security by webauthn4j.
the class AssertionOptionsTest method equals_hashCode_test.
@Test
public void equals_hashCode_test() {
String rpId = "example.com";
long timeout = 0;
Challenge challenge = new DefaultChallenge();
byte[] credentialId = new byte[32];
List<PublicKeyCredentialDescriptor> allowCredentials = Collections.singletonList(new PublicKeyCredentialDescriptor(PublicKeyCredentialType.PUBLIC_KEY, credentialId, CollectionUtil.unmodifiableSet(AuthenticatorTransport.USB, AuthenticatorTransport.NFC, AuthenticatorTransport.BLE)));
AssertionOptions instanceA = new AssertionOptions(challenge, timeout, rpId, allowCredentials, UserVerificationRequirement.DISCOURAGED, null);
AssertionOptions instanceB = new AssertionOptions(challenge, timeout, rpId, allowCredentials, UserVerificationRequirement.DISCOURAGED, null);
assertAll(() -> assertThat(instanceA).isEqualTo(instanceB), () -> assertThat(instanceA).hasSameHashCodeAs(instanceB));
}
Aggregations