@Test public void getServerConfiguration_useDynamic() { Mockito.when(mockStaticService.getServerConfiguration(issuer)).thenReturn(null); Mockito.when(mockDynamicService.getServerConfiguration(issuer)).thenReturn(mockServerConfig); ServerConfiguration result = hybridService.getServerConfiguration(issuer); Mockito.verify(mockStaticService).getServerConfiguration(issuer); Mockito.verify(mockDynamicService).getServerConfiguration(issuer); assertEquals(mockServerConfig, result); }
@Override public ServerConfiguration getServerConfiguration(String issuer) { ServerConfiguration server = staticServerService.getServerConfiguration(issuer); if (server != null) { return server; } else { return dynamicServerService.getServerConfiguration(issuer); } }
HybridServerConfigurationService implements ServerConfigurationService { @Override public ServerConfiguration getServerConfiguration(String issuer) { ServerConfiguration server = staticServerService.getServerConfiguration(issuer); if (server != null) { return server; } else { return dynamicServerService.getServerConfiguration(issuer); } } }
HybridServerConfigurationService implements ServerConfigurationService { @Override public ServerConfiguration getServerConfiguration(String issuer) { ServerConfiguration server = staticServerService.getServerConfiguration(issuer); if (server != null) { return server; } else { return dynamicServerService.getServerConfiguration(issuer); } }  }
HybridServerConfigurationService implements ServerConfigurationService { @Override public ServerConfiguration getServerConfiguration(String issuer) { ServerConfiguration server = staticServerService.getServerConfiguration(issuer); if (server != null) { return server; } else { return dynamicServerService.getServerConfiguration(issuer); } }  @Override ServerConfiguration getServerConfiguration(String issuer); Map<String, ServerConfiguration> getServers(); void setServers(Map<String, ServerConfiguration> servers); Set<String> getWhitelist(); void setWhitelist(Set<String> whitelist); Set<String> getBlacklist(); void setBlacklist(Set<String> blacklist); }
HybridServerConfigurationService implements ServerConfigurationService { @Override public ServerConfiguration getServerConfiguration(String issuer) { ServerConfiguration server = staticServerService.getServerConfiguration(issuer); if (server != null) { return server; } else { return dynamicServerService.getServerConfiguration(issuer); } }  @Override ServerConfiguration getServerConfiguration(String issuer); Map<String, ServerConfiguration> getServers(); void setServers(Map<String, ServerConfiguration> servers); Set<String> getWhitelist(); void setWhitelist(Set<String> whitelist); Set<String> getBlacklist(); void setBlacklist(Set<String> blacklist);  }