RemoteConfigRepository extends AbstractConfigRepository { @Override public Properties getConfig() { if (m_configCache.get() == null) { this.sync(); } return transformApolloConfigToProperties(m_configCache.get()); } RemoteConfigRepository(String namespace); @Override Properties getConfig(); @Override void setUpstreamRepository(ConfigRepository upstreamConfigRepository); @Override ConfigSourceType getSourceType(); void onLongPollNotified(ServiceDTO longPollNotifiedServiceDto, ApolloNotificationMessages remoteMessages);  }
@Test(expected = ApolloConfigException.class) public void testGetRemoteConfigWithServerError() throws Exception { when(someResponse.getStatusCode()).thenReturn(500); RemoteConfigRepository remoteConfigRepository = new RemoteConfigRepository(someNamespace); remoteConfigLongPollService.stopLongPollingRefresh(); remoteConfigRepository.getConfig(); }
@Test(expected = ApolloConfigException.class) public void testGetRemoteConfigWithNotFount() throws Exception { when(someResponse.getStatusCode()).thenReturn(404); RemoteConfigRepository remoteConfigRepository = new RemoteConfigRepository(someNamespace); remoteConfigLongPollService.stopLongPollingRefresh(); remoteConfigRepository.getConfig(); }