@Test public void testLoadAllClients() { for (int i = 0; i < 10; i++) { List<DbLoadedSamlClientConfigurationDto> all = daoUnderTest.loadAllClients(); assertNotNull(all); assertEquals(3, all.size()); } verify(realDaoMock, times(0)).loadClientNames(); verify(realDaoMock, times(1)).loadAllClients(); verify(realDaoMock, times(0)).loadClient(anyString()); }
@Override public List<DbLoadedSamlClientConfigurationDto> loadAllClients() { checkAndLoadFromRealDao(); Collection<DbLoadedSamlClientConfigurationDto> values = cachedConfigurations.values(); return new ArrayList<DbLoadedSamlClientConfigurationDto>(values); }
CachingSamlClientDaoImpl implements SamlClientDao { @Override public List<DbLoadedSamlClientConfigurationDto> loadAllClients() { checkAndLoadFromRealDao(); Collection<DbLoadedSamlClientConfigurationDto> values = cachedConfigurations.values(); return new ArrayList<DbLoadedSamlClientConfigurationDto>(values); } }
CachingSamlClientDaoImpl implements SamlClientDao { @Override public List<DbLoadedSamlClientConfigurationDto> loadAllClients() { checkAndLoadFromRealDao(); Collection<DbLoadedSamlClientConfigurationDto> values = cachedConfigurations.values(); return new ArrayList<DbLoadedSamlClientConfigurationDto>(values); } CachingSamlClientDaoImpl(final SamlClientDao realDao); }
CachingSamlClientDaoImpl implements SamlClientDao { @Override public List<DbLoadedSamlClientConfigurationDto> loadAllClients() { checkAndLoadFromRealDao(); Collection<DbLoadedSamlClientConfigurationDto> values = cachedConfigurations.values(); return new ArrayList<DbLoadedSamlClientConfigurationDto>(values); } CachingSamlClientDaoImpl(final SamlClientDao realDao); @Override List<String> loadClientNames(); @Override List<DbLoadedSamlClientConfigurationDto> loadAllClients(); @Override DbLoadedSamlClientConfigurationDto loadClient(String clientName); }
CachingSamlClientDaoImpl implements SamlClientDao { @Override public List<DbLoadedSamlClientConfigurationDto> loadAllClients() { checkAndLoadFromRealDao(); Collection<DbLoadedSamlClientConfigurationDto> values = cachedConfigurations.values(); return new ArrayList<DbLoadedSamlClientConfigurationDto>(values); } CachingSamlClientDaoImpl(final SamlClientDao realDao); @Override List<String> loadClientNames(); @Override List<DbLoadedSamlClientConfigurationDto> loadAllClients(); @Override DbLoadedSamlClientConfigurationDto loadClient(String clientName);  }