### Question:
WebAuthnCredentialProvider implements CredentialProvider, CredentialInputValidator, CredentialInputUpdater { @Override public Set<String> getDisableableCredentialTypes(RealmModel realm, UserModel user) { return isConfiguredFor(realm, user, WebAuthnCredentialModel.WEBAUTHN_CREDENTIAL_TYPE) ? Collections.singleton(WebAuthnCredentialModel.WEBAUTHN_CREDENTIAL_TYPE) : Collections.emptySet(); } WebAuthnCredentialProvider(KeycloakSession session); @Override boolean updateCredential(RealmModel realm, UserModel user, CredentialInput input); @Override void disableCredentialType(RealmModel realm, UserModel user, String credentialType); @Override Set<String> getDisableableCredentialTypes(RealmModel realm, UserModel user); @Override boolean supportsCredentialType(String credentialType); @Override boolean isConfiguredFor(RealmModel realm, UserModel user, String credentialType); @Override boolean isValid(RealmModel realm, UserModel user, CredentialInput input);  }### Answer:
@Test public void test_getDisableableCredentialTypes() { when(session.userCredentialManager() .getStoredCredentialsByType(any(RealmModel.class), any(UserModel.class), anyString()) .isEmpty()) .thenReturn(false); Assert.assertFalse(provider.getDisableableCredentialTypes(mock(RealmModel.class), mock(UserModel.class)).isEmpty()); }
@Test public void test_getDisableableCredentialTypes_empty() { when(session.userCredentialManager() .getStoredCredentialsByType(any(RealmModel.class), any(UserModel.class), anyString()) .isEmpty()) .thenReturn(true); Assert.assertTrue(provider.getDisableableCredentialTypes(mock(RealmModel.class), mock(UserModel.class)).isEmpty()); }