@Test public void addArchetypeTest() { doReturn(false).when(archetypePreferencesManager).containsArchetype(ARCHETYPE_ALIAS); archetypePreferencesManager.addArchetype(ARCHETYPE_ALIAS); verify(archetypePreferences).load(); verify(archetypePreferences).save(any(PreferenceScope.class)); verify(workbenchPreferenceScopeResolutionStrategies, times(3)).getSpaceInfoFor(anyString()); verify(archetypePreferences, times(3)).load(any(PreferenceScopeResolutionStrategyInfo.class)); verify(archetypePreferences, times(3)).save(any(PreferenceScopeResolutionStrategyInfo.class)); }
public void addArchetype(final String archetype) { archetypePreferences.load(); if (addArchetypePreference(archetype)) { archetypePreferences.save(getGlobalScope()); } getOuIdentifiers().forEach(identifier -> { final PreferenceScopeResolutionStrategyInfo info = workbenchPreferenceScopeResolutionStrategies.getSpaceInfoFor(identifier); archetypePreferences.load(info); if (addArchetypePreference(archetype)) { archetypePreferences.save(info); } }); }
ArchetypePreferencesManager { public void addArchetype(final String archetype) { archetypePreferences.load(); if (addArchetypePreference(archetype)) { archetypePreferences.save(getGlobalScope()); } getOuIdentifiers().forEach(identifier -> { final PreferenceScopeResolutionStrategyInfo info = workbenchPreferenceScopeResolutionStrategies.getSpaceInfoFor(identifier); archetypePreferences.load(info); if (addArchetypePreference(archetype)) { archetypePreferences.save(info); } }); } }
ArchetypePreferencesManager { public void addArchetype(final String archetype) { archetypePreferences.load(); if (addArchetypePreference(archetype)) { archetypePreferences.save(getGlobalScope()); } getOuIdentifiers().forEach(identifier -> { final PreferenceScopeResolutionStrategyInfo info = workbenchPreferenceScopeResolutionStrategies.getSpaceInfoFor(identifier); archetypePreferences.load(info); if (addArchetypePreference(archetype)) { archetypePreferences.save(info); } }); } ArchetypePreferencesManager(); @Inject  ArchetypePreferencesManager(final PreferenceScopeFactory scopeFactory,
                                       final WorkbenchPreferenceScopeResolutionStrategies workbenchPreferenceScopeResolutionStrategies,
                                       final ArchetypePreferences archetypePreferences,
                                       final OrganizationalUnitService ouService); }
ArchetypePreferencesManager { public void addArchetype(final String archetype) { archetypePreferences.load(); if (addArchetypePreference(archetype)) { archetypePreferences.save(getGlobalScope()); } getOuIdentifiers().forEach(identifier -> { final PreferenceScopeResolutionStrategyInfo info = workbenchPreferenceScopeResolutionStrategies.getSpaceInfoFor(identifier); archetypePreferences.load(info); if (addArchetypePreference(archetype)) { archetypePreferences.save(info); } }); } ArchetypePreferencesManager(); @Inject  ArchetypePreferencesManager(final PreferenceScopeFactory scopeFactory,
                                       final WorkbenchPreferenceScopeResolutionStrategies workbenchPreferenceScopeResolutionStrategies,
                                       final ArchetypePreferences archetypePreferences,
                                       final OrganizationalUnitService ouService); void addArchetype(final String archetype); void removeArchetype(final String archetype); void setDefaultArchetype(final String archetype); void initializeCustomPreferences(); void initializeCustomPreference(final String identifier); void enableArchetype(final String archetype,
                                final boolean isEnabled,
                                final boolean customIncluded); }
ArchetypePreferencesManager { public void addArchetype(final String archetype) { archetypePreferences.load(); if (addArchetypePreference(archetype)) { archetypePreferences.save(getGlobalScope()); } getOuIdentifiers().forEach(identifier -> { final PreferenceScopeResolutionStrategyInfo info = workbenchPreferenceScopeResolutionStrategies.getSpaceInfoFor(identifier); archetypePreferences.load(info); if (addArchetypePreference(archetype)) { archetypePreferences.save(info); } }); } ArchetypePreferencesManager(); @Inject  ArchetypePreferencesManager(final PreferenceScopeFactory scopeFactory,
                                       final WorkbenchPreferenceScopeResolutionStrategies workbenchPreferenceScopeResolutionStrategies,
                                       final ArchetypePreferences archetypePreferences,
                                       final OrganizationalUnitService ouService); void addArchetype(final String archetype); void removeArchetype(final String archetype); void setDefaultArchetype(final String archetype); void initializeCustomPreferences(); void initializeCustomPreference(final String identifier); void enableArchetype(final String archetype,
                                final boolean isEnabled,
                                final boolean customIncluded);  }