@Test public void newOrgUnitEventWhenShouldInitializePreferencesTest() { doReturn(Collections.nCopies(10, mock(OrganizationalUnit.class))) .when(ouService).getAllOrganizationalUnits(eq(false), any()); final NewOrganizationalUnitEvent event = mock(NewOrganizationalUnitEvent.class); final OrganizationalUnit orgUnit = mock(OrganizationalUnit.class); doReturn("new-org-unit").when(orgUnit).getName(); doReturn(orgUnit).when(event).getOrganizationalUnit(); service.onNewOrganizationalUnitEvent(event); verify(archetypePreferencesManager).initializeCustomPreference(anyString()); }
public void onNewOrganizationalUnitEvent(final @Observes NewOrganizationalUnitEvent newOrganizationalUnitEvent) { final OrganizationalUnit newOU = newOrganizationalUnitEvent.getOrganizationalUnit(); if (isArchetypesOUAvailable() && !newOU.getName().equals(ArchetypeConfigStorageImpl.ARCHETYPES_SPACE_NAME)) { archetypePreferencesManager.initializeCustomPreference(newOU.getIdentifier()); } }
ArchetypeServiceImpl implements ArchetypeService { public void onNewOrganizationalUnitEvent(final @Observes NewOrganizationalUnitEvent newOrganizationalUnitEvent) { final OrganizationalUnit newOU = newOrganizationalUnitEvent.getOrganizationalUnit(); if (isArchetypesOUAvailable() && !newOU.getName().equals(ArchetypeConfigStorageImpl.ARCHETYPES_SPACE_NAME)) { archetypePreferencesManager.initializeCustomPreference(newOU.getIdentifier()); } } }
ArchetypeServiceImpl implements ArchetypeService { public void onNewOrganizationalUnitEvent(final @Observes NewOrganizationalUnitEvent newOrganizationalUnitEvent) { final OrganizationalUnit newOU = newOrganizationalUnitEvent.getOrganizationalUnit(); if (isArchetypesOUAvailable() && !newOU.getName().equals(ArchetypeConfigStorageImpl.ARCHETYPES_SPACE_NAME)) { archetypePreferencesManager.initializeCustomPreference(newOU.getIdentifier()); } } ArchetypeServiceImpl(); @Inject  ArchetypeServiceImpl(final @Named("ioStrategy") IOService ioService,
                                final RepositoryService repositoryService,
                                final OrganizationalUnitService ouService,
                                final Event<ArchetypeListUpdatedEvent> archetypeListUpdatedEvent,
                                final ArchetypeConfigStorage archetypeConfigStorage,
                                final PathUtil pathUtil,
                                final ArchetypePreferencesManager archetypePreferencesManager,
                                final KieModuleService moduleService,
                                final POMService pomService); }
ArchetypeServiceImpl implements ArchetypeService { public void onNewOrganizationalUnitEvent(final @Observes NewOrganizationalUnitEvent newOrganizationalUnitEvent) { final OrganizationalUnit newOU = newOrganizationalUnitEvent.getOrganizationalUnit(); if (isArchetypesOUAvailable() && !newOU.getName().equals(ArchetypeConfigStorageImpl.ARCHETYPES_SPACE_NAME)) { archetypePreferencesManager.initializeCustomPreference(newOU.getIdentifier()); } } ArchetypeServiceImpl(); @Inject  ArchetypeServiceImpl(final @Named("ioStrategy") IOService ioService,
                                final RepositoryService repositoryService,
                                final OrganizationalUnitService ouService,
                                final Event<ArchetypeListUpdatedEvent> archetypeListUpdatedEvent,
                                final ArchetypeConfigStorage archetypeConfigStorage,
                                final PathUtil pathUtil,
                                final ArchetypePreferencesManager archetypePreferencesManager,
                                final KieModuleService moduleService,
                                final POMService pomService); void onNewOrganizationalUnitEvent(final @Observes NewOrganizationalUnitEvent newOrganizationalUnitEvent); @Override void add(final GAV archetypeGav); @Override void add(final GAV archetypeGav,
                    final GAV templateGav); @Override PaginatedArchetypeList list(final Integer page,
                                       final Integer pageSize,
                                       final String filter); @Override PaginatedArchetypeList list(final Integer page,
                                       final Integer pageSize,
                                       final String filter,
                                       final ArchetypeStatus status); @Override void delete(final String alias); @Override void validateAll(); @Override void validate(final String alias); @Override Repository getTemplateRepository(final String alias); @Override Optional<Repository> getBaseKieTemplateRepository(); @Override Optional<Archetype> getBaseKieArchetype(); }
ArchetypeServiceImpl implements ArchetypeService { public void onNewOrganizationalUnitEvent(final @Observes NewOrganizationalUnitEvent newOrganizationalUnitEvent) { final OrganizationalUnit newOU = newOrganizationalUnitEvent.getOrganizationalUnit(); if (isArchetypesOUAvailable() && !newOU.getName().equals(ArchetypeConfigStorageImpl.ARCHETYPES_SPACE_NAME)) { archetypePreferencesManager.initializeCustomPreference(newOU.getIdentifier()); } } ArchetypeServiceImpl(); @Inject  ArchetypeServiceImpl(final @Named("ioStrategy") IOService ioService,
                                final RepositoryService repositoryService,
                                final OrganizationalUnitService ouService,
                                final Event<ArchetypeListUpdatedEvent> archetypeListUpdatedEvent,
                                final ArchetypeConfigStorage archetypeConfigStorage,
                                final PathUtil pathUtil,
                                final ArchetypePreferencesManager archetypePreferencesManager,
                                final KieModuleService moduleService,
                                final POMService pomService); void onNewOrganizationalUnitEvent(final @Observes NewOrganizationalUnitEvent newOrganizationalUnitEvent); @Override void add(final GAV archetypeGav); @Override void add(final GAV archetypeGav,
                    final GAV templateGav); @Override PaginatedArchetypeList list(final Integer page,
                                       final Integer pageSize,
                                       final String filter); @Override PaginatedArchetypeList list(final Integer page,
                                       final Integer pageSize,
                                       final String filter,
                                       final ArchetypeStatus status); @Override void delete(final String alias); @Override void validateAll(); @Override void validate(final String alias); @Override Repository getTemplateRepository(final String alias); @Override Optional<Repository> getBaseKieTemplateRepository(); @Override Optional<Archetype> getBaseKieArchetype();  }