JdbcUserGoogleMfaCredentialsProvisioning implements SystemDeletable, UserMfaCredentialsProvisioning<UserGoogleMfaCredentials> { @Override public int delete(String userId) { return jdbcTemplate.update(DELETE_USER_MFA_CONFIG_SQL, userId); } JdbcUserGoogleMfaCredentialsProvisioning(JdbcTemplate jdbcTemplate, EncryptionKeyService encryptionKeyService); @Override void save(UserGoogleMfaCredentials credentials, String zoneId); @Override void update(UserGoogleMfaCredentials credentials, String zoneId); @Override UserGoogleMfaCredentials retrieve(String userId, String mfaProviderId); @Override int deleteByUser(String userId, String zoneId); @Override int deleteByMfaProvider(String mfaProviderId, String zoneId); @Override int deleteByIdentityZone(String zoneId); @Override int delete(String userId); @Override Logger getLogger();  }
@Test void delete() { assertEquals(0, jdbcTemplate.queryForList("SELECT * FROM user_google_mfa_credentials").size()); db.save(new UserGoogleMfaCredentials("user1", "secret", 12345, Collections.singletonList(123)).setMfaProviderId(MFA_ID), zoneId); assertEquals(1, jdbcTemplate.queryForList("SELECT * FROM user_google_mfa_credentials").size()); db.delete("user1"); assertEquals(0, jdbcTemplate.queryForList("SELECT * FROM user_google_mfa_credentials").size()); }