JdbcSamlServiceProviderProvisioning implements SamlServiceProviderProvisioning, SamlServiceProviderDeletable { @Override public List<SamlServiceProvider> retrieveActive(String zoneId) { return jdbcTemplate.query(ACTIVE_SERVICE_PROVIDERS_QUERY, mapper, zoneId, true); } JdbcSamlServiceProviderProvisioning(JdbcTemplate jdbcTemplate); @Override SamlServiceProvider retrieve(String id, String zoneId); @Override void delete(String id, String zoneId); @Override int deleteByEntityId(String entityId, String zoneId); @Override int deleteByIdentityZone(String zoneId); @Override List<SamlServiceProvider> retrieveActive(String zoneId); @Override List<SamlServiceProvider> retrieveAll(boolean activeOnly, String zoneId); @Override SamlServiceProvider retrieveByEntityId(String entityId, String zoneId); @Override SamlServiceProvider create(final SamlServiceProvider serviceProvider, final String zoneId); @Override SamlServiceProvider update(final SamlServiceProvider serviceProvider, String zoneId); @Override Logger getLogger(); static final String SERVICE_PROVIDER_FIELDS; static final String CREATE_SERVICE_PROVIDER_SQL; static final String DELETE_SERVICE_PROVIDER_SQL; static final String DELETE_SERVICE_PROVIDER_BY_ENTITY_ID_SQL; static final String DELETE_SERVICE_PROVIDER_BY_ZONE_SQL; static final String SERVICE_PROVIDERS_QUERY; static final String ACTIVE_SERVICE_PROVIDERS_QUERY; static final String SERVICE_PROVIDER_UPDATE_FIELDS; static final String UPDATE_SERVICE_PROVIDER_SQL; static final String SERVICE_PROVIDER_BY_ID_QUERY; static final String SERVICE_PROVIDER_BY_ENTITY_ID_QUERY; }
@Test void retrieveActive() { assertEquals(0, db.retrieveActive(IdentityZone.getUaaZoneId()).size()); String zoneId = IdentityZone.getUaaZoneId(); SamlServiceProvider sp = createSamlServiceProvider(zoneId); SamlServiceProvider createdSp = db.create(sp, sp.getIdentityZoneId()); assertEquals(1, db.retrieveActive(IdentityZone.getUaaZoneId()).size()); jdbcTemplate.update("update service_provider set active=?", false); assertEquals(0, db.retrieveActive(IdentityZone.getUaaZoneId()).size()); }