@Test void getValue_with_invalid_key_test(){ CredentialProtectionExtensionClientInput target = new CredentialProtectionExtensionClientInput(CredentialProtectionPolicy.USER_VERIFICATION_OPTIONAL_WITH_CREDENTIAL_ID_LIST, true); assertThatThrownBy(()->target.getValue("invalid")).isInstanceOf(IllegalArgumentException.class); }
@Override public Serializable getValue(String key) { switch (key) { case KEY_CREDENTIAL_PROTECTION_POLICY: return credentialProtectionPolicy; case KEY_ENFORCE_CREDENTIAL_PROTECTION_POLICY: return enforceCredentialProtectionPolicy; default: throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } }
CredentialProtectionExtensionClientInput implements RegistrationExtensionClientInput { @Override public Serializable getValue(String key) { switch (key) { case KEY_CREDENTIAL_PROTECTION_POLICY: return credentialProtectionPolicy; case KEY_ENFORCE_CREDENTIAL_PROTECTION_POLICY: return enforceCredentialProtectionPolicy; default: throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } } }
CredentialProtectionExtensionClientInput implements RegistrationExtensionClientInput { @Override public Serializable getValue(String key) { switch (key) { case KEY_CREDENTIAL_PROTECTION_POLICY: return credentialProtectionPolicy; case KEY_ENFORCE_CREDENTIAL_PROTECTION_POLICY: return enforceCredentialProtectionPolicy; default: throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } } CredentialProtectionExtensionClientInput(
            CredentialProtectionPolicy credentialProtectionPolicy, Boolean enforceCredentialProtectionPolicy);  CredentialProtectionExtensionClientInput(CredentialProtectionPolicy credentialProtectionPolicy); }
CredentialProtectionExtensionClientInput implements RegistrationExtensionClientInput { @Override public Serializable getValue(String key) { switch (key) { case KEY_CREDENTIAL_PROTECTION_POLICY: return credentialProtectionPolicy; case KEY_ENFORCE_CREDENTIAL_PROTECTION_POLICY: return enforceCredentialProtectionPolicy; default: throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } } CredentialProtectionExtensionClientInput(
            CredentialProtectionPolicy credentialProtectionPolicy, Boolean enforceCredentialProtectionPolicy);  CredentialProtectionExtensionClientInput(CredentialProtectionPolicy credentialProtectionPolicy); @Override String getIdentifier(); CredentialProtectionPolicy getCredentialProtectionPolicy(); Boolean getEnforceCredentialProtectionPolicy(); @Override Serializable getValue(String key); @Override void validate(); }
CredentialProtectionExtensionClientInput implements RegistrationExtensionClientInput { @Override public Serializable getValue(String key) { switch (key) { case KEY_CREDENTIAL_PROTECTION_POLICY: return credentialProtectionPolicy; case KEY_ENFORCE_CREDENTIAL_PROTECTION_POLICY: return enforceCredentialProtectionPolicy; default: throw new IllegalArgumentException(String.format("%s is not valid key.", key)); } } CredentialProtectionExtensionClientInput(
            CredentialProtectionPolicy credentialProtectionPolicy, Boolean enforceCredentialProtectionPolicy);  CredentialProtectionExtensionClientInput(CredentialProtectionPolicy credentialProtectionPolicy); @Override String getIdentifier(); CredentialProtectionPolicy getCredentialProtectionPolicy(); Boolean getEnforceCredentialProtectionPolicy(); @Override Serializable getValue(String key); @Override void validate(); static final String ID; static final String KEY_CREDENTIAL_PROTECTION_POLICY; static final String KEY_ENFORCE_CREDENTIAL_PROTECTION_POLICY; }