Search in sources :

Example 1 with RemoteConfigRepository

use of com.ctrip.framework.apollo.internals.RemoteConfigRepository in project apollo by ctripcorp.

the class DefaultConfigFactoryFileCachePropertyTest method testCreateFileDisableConfigRepository.

@Test
public void testCreateFileDisableConfigRepository() throws Exception {
    RemoteConfigRepository someRemoteConfigRepository = mock(RemoteConfigRepository.class);
    when(someConfigUtil.isPropertyFileCacheEnabled()).thenReturn(false);
    doReturn(someRemoteConfigRepository).when(configFactory).createRemoteConfigRepository(someNamespace);
    ConfigRepository configRepository = configFactory.createConfigRepository(someNamespace);
    assertSame(someRemoteConfigRepository, configRepository);
    verify(configFactory, never()).createLocalConfigRepository(someNamespace);
    verify(configFactory, times(1)).createRemoteConfigRepository(someNamespace);
}
Also used : RemoteConfigRepository(com.ctrip.framework.apollo.internals.RemoteConfigRepository) RemoteConfigRepository(com.ctrip.framework.apollo.internals.RemoteConfigRepository) LocalFileConfigRepository(com.ctrip.framework.apollo.internals.LocalFileConfigRepository) ConfigRepository(com.ctrip.framework.apollo.internals.ConfigRepository) Test(org.junit.Test)

Aggregations

ConfigRepository (com.ctrip.framework.apollo.internals.ConfigRepository)1 LocalFileConfigRepository (com.ctrip.framework.apollo.internals.LocalFileConfigRepository)1 RemoteConfigRepository (com.ctrip.framework.apollo.internals.RemoteConfigRepository)1 Test (org.junit.Test)1