RegistryCenter { public Collection<String> loadDisabledDataSources(final String schemaName) { return loadDataSourcesBySchemaName(schemaName).stream().filter(each -> !Strings.isNullOrEmpty(getDataSourceNodeData(schemaName, each)) && RegistryCenterNodeStatus.DISABLED.toString().equalsIgnoreCase(getDataSourceNodeData(schemaName, each))).collect(Collectors.toList()); } RegistryCenter(final RegistryRepository registryRepository); void persistInstanceOnline(); void persistDataNodes(); void persistInstanceData(final String instanceData); String loadInstanceData(); Collection<String> loadDisabledDataSources(final String schemaName);  }
@Test public void assertLoadDisabledDataSources() { List<String> disabledDataSources = Collections.singletonList("replica_ds_0"); when(registryRepository.getChildrenKeys(anyString())).thenReturn(disabledDataSources); registryCenter.loadDisabledDataSources("primary_replica_db"); verify(registryRepository).getChildrenKeys(anyString()); verify(registryRepository).get(anyString()); }