JdbcMfaProviderProvisioning implements MfaProviderProvisioning, SystemDeletable { @Override public MfaProvider retrieve(String id, String zoneId) { return jdbcTemplate.queryForObject(MFA_PROVIDER_BY_ID_QUERY, mapper, id, zoneId); } JdbcMfaProviderProvisioning(JdbcTemplate jdbcTemplate, MfaProviderValidator mfaProviderValidator); @Override MfaProvider create(MfaProvider provider, String zoneId); @Override MfaProvider update(MfaProvider provider, String zoneId); @Override MfaProvider retrieve(String id, String zoneId); @Override MfaProvider retrieveByName(String name, String zoneId); @Override List<MfaProvider> retrieveAll(String zoneId); @Override int deleteByMfaProvider(String providerId, String zoneId); @Override int deleteByIdentityZone(String zoneId); @Override Logger getLogger(); static final String TABLE_NAME; static final String MFA_PROVIDER_FIELDS; static final String CREATE_PROVIDER_SQL; static final String MFA_PROVIDER_UPDATE_FIELDS; static final String UPDATE_PROVIDER_SQL; static final String MFA_PROVIDER_BY_ID_QUERY; static final String MFA_PROVIDER_BY_NAME_QUERY; static final String MFA_PROVIDERS_QUERY; static final String MFA_PROVIDER_DELETE_BY_ID; static final String MFA_PROVIDER_DELETE_BY_ZONE_ID; }
@Test void retrieve() { MfaProvider mfaProvider = constructGoogleProvider(); doNothing().when(mfaProviderValidator); String zoneId = IdentityZoneHolder.get().getId(); MfaProvider created = mfaProviderProvisioning.create(mfaProvider, zoneId); assertEquals(mfaProvider.getName(), created.getName()); assertNotNull(created.getId()); }