@Test void getValue_with_valid_key_test(){ CredentialProtectionExtensionAuthenticatorInput target = new CredentialProtectionExtensionAuthenticatorInput(CredentialProtectionPolicy.USER_VERIFICATION_OPTIONAL_WITH_CREDENTIAL_ID_LIST); assertThatCode(()->target.getValue("credProtect")).doesNotThrowAnyException(); }
@Override public Serializable getValue(String key) { if (KEY_CRED_PROTECT.equals(key)) { return credProtect; } throw new IllegalArgumentException(String.format("%s is not valid key.", key)); }
CredentialProtectionExtensionAuthenticatorInput implements RegistrationExtensionAuthenticatorInput { @Override public Serializable getValue(String key) { if (KEY_CRED_PROTECT.equals(key)) { return credProtect; } throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } }
CredentialProtectionExtensionAuthenticatorInput implements RegistrationExtensionAuthenticatorInput { @Override public Serializable getValue(String key) { if (KEY_CRED_PROTECT.equals(key)) { return credProtect; } throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } CredentialProtectionExtensionAuthenticatorInput(CredentialProtectionPolicy credProtect); }
CredentialProtectionExtensionAuthenticatorInput implements RegistrationExtensionAuthenticatorInput { @Override public Serializable getValue(String key) { if (KEY_CRED_PROTECT.equals(key)) { return credProtect; } throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } CredentialProtectionExtensionAuthenticatorInput(CredentialProtectionPolicy credProtect); @Override String getIdentifier(); CredentialProtectionPolicy getCredProtect(); @Override Serializable getValue(String key); @Override void validate(); }
CredentialProtectionExtensionAuthenticatorInput implements RegistrationExtensionAuthenticatorInput { @Override public Serializable getValue(String key) { if (KEY_CRED_PROTECT.equals(key)) { return credProtect; } throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } CredentialProtectionExtensionAuthenticatorInput(CredentialProtectionPolicy credProtect); @Override String getIdentifier(); CredentialProtectionPolicy getCredProtect(); @Override Serializable getValue(String key); @Override void validate(); static final String ID; static final String KEY_CRED_PROTECT; }