@Test public void getClientConfiguration_useDynamic() { Mockito.when(mockStaticService.getClientConfiguration(mockServerConfig)).thenReturn(null); Mockito.when(mockDynamicService.getClientConfiguration(mockServerConfig)).thenReturn(mockClient); RegisteredClient result = hybridService.getClientConfiguration(mockServerConfig); Mockito.verify(mockStaticService).getClientConfiguration(mockServerConfig); Mockito.verify(mockDynamicService).getClientConfiguration(mockServerConfig); assertEquals(mockClient, result); }
@Override public RegisteredClient getClientConfiguration(ServerConfiguration issuer) { RegisteredClient client = staticClientService.getClientConfiguration(issuer); if (client != null) { return client; } else { return dynamicClientService.getClientConfiguration(issuer); } }
HybridClientConfigurationService implements ClientConfigurationService { @Override public RegisteredClient getClientConfiguration(ServerConfiguration issuer) { RegisteredClient client = staticClientService.getClientConfiguration(issuer); if (client != null) { return client; } else { return dynamicClientService.getClientConfiguration(issuer); } } }
HybridClientConfigurationService implements ClientConfigurationService { @Override public RegisteredClient getClientConfiguration(ServerConfiguration issuer) { RegisteredClient client = staticClientService.getClientConfiguration(issuer); if (client != null) { return client; } else { return dynamicClientService.getClientConfiguration(issuer); } }  }
HybridClientConfigurationService implements ClientConfigurationService { @Override public RegisteredClient getClientConfiguration(ServerConfiguration issuer) { RegisteredClient client = staticClientService.getClientConfiguration(issuer); if (client != null) { return client; } else { return dynamicClientService.getClientConfiguration(issuer); } }  @Override RegisteredClient getClientConfiguration(ServerConfiguration issuer); Map<String, RegisteredClient> getClients(); void setClients(Map<String, RegisteredClient> clients); RegisteredClient getTemplate(); void setTemplate(RegisteredClient template); RegisteredClientService getRegisteredClientService(); void setRegisteredClientService(RegisteredClientService registeredClientService); Set<String> getWhitelist(); void setWhitelist(Set<String> whitelist); Set<String> getBlacklist(); void setBlacklist(Set<String> blacklist); }
HybridClientConfigurationService implements ClientConfigurationService { @Override public RegisteredClient getClientConfiguration(ServerConfiguration issuer) { RegisteredClient client = staticClientService.getClientConfiguration(issuer); if (client != null) { return client; } else { return dynamicClientService.getClientConfiguration(issuer); } }  @Override RegisteredClient getClientConfiguration(ServerConfiguration issuer); Map<String, RegisteredClient> getClients(); void setClients(Map<String, RegisteredClient> clients); RegisteredClient getTemplate(); void setTemplate(RegisteredClient template); RegisteredClientService getRegisteredClientService(); void setRegisteredClientService(RegisteredClientService registeredClientService); Set<String> getWhitelist(); void setWhitelist(Set<String> whitelist); Set<String> getBlacklist(); void setBlacklist(Set<String> blacklist);  }