PropertiesCompatibleFileConfigRepository extends AbstractConfigRepository implements
    ConfigFileChangeListener { @Override public void onChange(ConfigFileChangeEvent changeEvent) { this.trySync(); } PropertiesCompatibleFileConfigRepository(PropertiesCompatibleConfigFile configFile); @Override Properties getConfig(); @Override void setUpstreamRepository(ConfigRepository upstreamConfigRepository); @Override ConfigSourceType getSourceType(); @Override void onChange(ConfigFileChangeEvent changeEvent);  }
@Test public void testOnChange() throws Exception { Properties anotherProperties = mock(Properties.class); ConfigFileChangeEvent someChangeEvent = mock(ConfigFileChangeEvent.class); RepositoryChangeListener someListener = mock(RepositoryChangeListener.class); PropertiesCompatibleFileConfigRepository configFileRepository = new PropertiesCompatibleFileConfigRepository( configFile); configFileRepository.addChangeListener(someListener); assertSame(someProperties, configFileRepository.getConfig()); when(configFile.asProperties()).thenReturn(anotherProperties); configFileRepository.onChange(someChangeEvent); assertSame(anotherProperties, configFileRepository.getConfig()); verify(someListener, times(1)).onRepositoryChange(someNamespaceName, anotherProperties); }