/** * {@inheritDoc}. * * <p> * This implementation simply delegate the functionality to the internal {@link ConfigStore}/version * </p> */ @Override public Collection<ConfigKeyPath> getChildren(ConfigKeyPath configKey) { return this.cs.getChildren(configKey, this.version); }
public static void addConfigStoreChildren(ConfigStore mockup, String version, ConfigKeyPath parent, ConfigKeyPath... configKeyPaths) { List<ConfigKeyPath> children = new ArrayList<ConfigKeyPath>(); for (ConfigKeyPath p : configKeyPaths) { children.add(p); } when(mockup.getChildren(parent, version)).thenReturn(children); }
private void mockupConfigValues(){ // mock up the configuration values for root Map<String, String> rootMap = new HashMap<>(); rootMap.put("keyInRoot", "valueInRoot"); when(mockConfigStore.getOwnConfig(SingleLinkedListConfigKeyPath.ROOT, version)).thenReturn(ConfigFactory.parseMap(rootMap)); Collection<ConfigKeyPath> currentLevel = mockConfigStore.getChildren(SingleLinkedListConfigKeyPath.ROOT, version); while(!currentLevel.isEmpty()){ Collection<ConfigKeyPath> nextLevel = new ArrayList<ConfigKeyPath>(); for(ConfigKeyPath p: currentLevel){ mockupConfigValueForKey(p); nextLevel.addAll(mockConfigStore.getChildren(p, version)); } currentLevel = nextLevel; } }
rootChildren.add(tag); rootChildren.add(tag2); when(mockConfigStore.getChildren(SingleLinkedListConfigKeyPath.ROOT, version)).thenReturn(rootChildren); when(mockConfigStore.getChildren(data, version)).thenReturn(dataChildren); when(mockConfigStore.getChildren(databases, version)).thenReturn(databasesChildren); when(mockConfigStore.getChildren(identity, version)).thenReturn(emptyList); when(mockConfigStore.getChildren(tag, version)).thenReturn(tagChildren); when(mockConfigStore.getChildren(highPriorityTag, version)).thenReturn(emptyList); when(mockConfigStore.getChildren(espressoTag, version)).thenReturn(emptyList); when(mockConfigStore.getChildren(tag2, version)).thenReturn(tag2Children); when(mockConfigStore.getChildren(nertzTag2, version)).thenReturn(emptyList);
rootChildren.add(tag); rootChildren.add(tag2); when(mockConfigStore.getChildren(SingleLinkedListConfigKeyPath.ROOT, version)).thenReturn(rootChildren); when(mockConfigStore.getChildren(data, version)).thenReturn(dataChildren); when(mockConfigStore.getChildren(databases, version)).thenReturn(databasesChildren); when(mockConfigStore.getChildren(identity, version)).thenReturn(emptyList); when(mockConfigStore.getChildren(tag, version)).thenReturn(tagChildren); when(mockConfigStore.getChildren(highPriorityTag, version)).thenReturn(emptyList); when(mockConfigStore.getChildren(espressoTag, version)).thenReturn(emptyList); when(mockConfigStore.getChildren(tag2, version)).thenReturn(tag2Children); when(mockConfigStore.getChildren(nertzTag2, version)).thenReturn(emptyList);
/** * {@inheritDoc}. * * <p> * This implementation simply delegate the functionality to the internal {@link ConfigStore}/version * </p> */ @Override public Collection<ConfigKeyPath> getChildren(ConfigKeyPath configKey) { return this.cs.getChildren(configKey, this.version); }