BasicParamEditor implements ParamEditor { @Override public List<RepositoryName> repositories() { return repositories.storedRepositories(); } BasicParamEditor(ParamEngine paramEngine, ParameterEntryMapConverter entryMapConverter); @Override List<RepositoryName> repositories(); @Override ParameterKey createParameter(RepositoryName in, Parameter parameter); @Override void updateParameter(RepositoryName in, String parameterName, Parameter parameter); @Override void deleteParameter(RepositoryName in, String parameterName); @Override DescribedEntity<LevelKey> addLevel(RepositoryName in, String parameterName, Level level); @Override void reorderLevels(RepositoryName in, String parameterName, List<LevelKey> orderedLevels); @Override void updateLevel(RepositoryName in, String parameterName, LevelKey levelKey, Level level); @Override void deleteLevel(RepositoryName in, String parameterName, LevelKey levelKey); @Override DescribedEntity<ParameterEntryKey> addEntry(RepositoryName in, String parameterName, MapEntry entryMap); @Override DescribedCollection<ParameterEntryKey> addEntries(RepositoryName in, String parameterName, Iterable<MapEntry> entries); @Override void updateEntry(RepositoryName in, String parameterName, ParameterEntryKey entryKey, MapEntry entryMap); @Override void deleteEntry(RepositoryName in, String parameterName, ParameterEntryKey entryKey); @Override void deleteEntries(RepositoryName in, String parameterName, Iterable<ParameterEntryKey> entryKeys); @Override void deleteEntries(RepositoryName in, String parameterName); @Override MapEntry normalize(Parameter metadata, MapEntry denormalizedEntry); @Override List<MapEntry> normalize(Parameter metadata, Iterable<MapEntry> denormalizedEntries);  }
@Test public void shouldRegisterAllEditableRepositoriesFromParamEngineInOrderWhenCreatingNewEditor() { ParamRepository viewableRepository = mock(ViewableParamRepository.class); ParamRepository editableRepository1 = new FakeEditableParamRepository(); ParamRepository editableRepository2 = new FakeEditableParamRepository(); ParamEngineConfig config = ParamEngineConfigBuilder.paramEngineConfig() .withParameterRepository("fake1", editableRepository1) .withParameterRepository(viewableRepository) .withParameterRepository("fake2", editableRepository2) .withAnnotationScanDisabled() .withType("string", new StringType()) .build(); ParamEngine paramEngine = ParamEngineFactory.paramEngine(config); BasicParamEditor localParamEditor = new BasicParamEditor(paramEngine, null); assertThat(localParamEditor.repositories()).containsOnly(RepositoryName.from("fake1"), RepositoryName.from("fake2")); }