JdbcClientMetadataProvisioning implements ClientMetadataProvisioning { @Override public List<ClientMetadata> retrieveAll(String zoneId) { logger.debug("Retrieving UI details for all client"); return jdbcTemplate.query(CLIENT_METADATAS_QUERY, mapper, zoneId); } JdbcClientMetadataProvisioning(
            final @Qualifier("jdbcClientDetailsService") MultitenantClientServices clientDetailsService,
            final JdbcTemplate jdbcTemplate); @Override List<ClientMetadata> retrieveAll(String zoneId); @Override ClientMetadata retrieve(String clientId, String zoneId); @Override ClientMetadata update(ClientMetadata resource, String zoneId);  }
@Test void retrieveAll() { String clientId1 = randomValueStringGenerator.generate(); String clientId2 = randomValueStringGenerator.generate(); String clientId3 = randomValueStringGenerator.generate(); jdbcTemplate.execute(insertIntoOauthClientDetailsWithMetadata(clientId1, identityZoneId, "createdBy", "appLaunchUrl")); jdbcTemplate.execute(insertIntoOauthClientDetailsWithMetadata(clientId2, identityZoneId, "createdBy", "appLaunchUrl")); jdbcTemplate.execute(insertIntoOauthClientDetailsWithMetadata(clientId3, "other-zone", "createdBy", "appLaunchUrl")); List<String> clientIds = jdbcClientMetadataProvisioning .retrieveAll(identityZoneId) .stream() .map(ClientMetadata::getClientId) .collect(Collectors.toList()); assertThat(clientIds, hasItem(clientId1)); assertThat(clientIds, hasItem(clientId2)); assertThat(clientIds, not(hasItem(clientId3))); }