DynamicRepositoryLocationLoader implements RepositoryLocationLoader { @Override public List<RepositoryLocation<? extends Repository>> loadRepositoryLocations() { return delegated.loadRepositoryLocations(); } DynamicRepositoryLocationLoader(ApplicationContext applicationContext, String beanName);  DynamicRepositoryLocationLoader(RepositoryLocationLoader repositoryLocationLoader); @Override List<RepositoryLocation<? extends Repository>> getDefaultRepositoryLocations(); @Override List<RepositoryLocation<? extends Repository>> loadRepositoryLocations(); @Override void saveRepositories(List<RepositoryLocation<? extends Repository>> repositoryLocations);  }
@Test public void loadRepositoryLocations() { final List<RepositoryLocation<? extends Repository>> mockRepositoriesToBeLoaded = Arrays.asList( mock(RepositoryLocation.class), mock(RepositoryLocation.class)); when(mockDelegated.loadRepositoryLocations()).thenReturn(mockRepositoriesToBeLoaded); assertSame(mockRepositoriesToBeLoaded, dynamicRepositoryLocationLoader.loadRepositoryLocations()); verify(mockDelegated).loadRepositoryLocations(); }