use of org.kie.workbench.common.screens.archetype.mgmt.shared.events.ArchetypeListUpdatedEvent in project kie-wb-common by kiegroup.
the class ArchetypeManagementScreenPresenterTest method fireNotificationOnArchetypeListUpdatedEvent.
private void fireNotificationOnArchetypeListUpdatedEvent(final ArchetypeListOperation operation, final String notificationMsg, final String tsKey) {
doReturn(notificationMsg).when(ts).getTranslation(tsKey);
doReturn(true).when(archetypeTablePresenter).isSetup();
presenter.onArchetypeListUpdatedEvent(new ArchetypeListUpdatedEvent(operation));
verify(notificationEvent).fire(new NotificationEvent(notificationMsg, NotificationEvent.NotificationType.SUCCESS));
}
use of org.kie.workbench.common.screens.archetype.mgmt.shared.events.ArchetypeListUpdatedEvent in project kie-wb-common by kiegroup.
the class ArchetypeServiceImpl method finishAddExternalArchetype.
private void finishAddExternalArchetype(final GAV templateGav, final File workingDirectory) throws GitAPIException, MavenEmbedderException {
final File repositoryDirectory = new File(workingDirectory, templateGav.getArtifactId());
final Archetype archetype = finishAddArchetype(templateGav, repositoryDirectory, false);
archetypePreferencesManager.addArchetype(archetype.getAlias());
archetypeListUpdatedEvent.fire(new ArchetypeListUpdatedEvent(ArchetypeListOperation.ADD));
}
use of org.kie.workbench.common.screens.archetype.mgmt.shared.events.ArchetypeListUpdatedEvent in project kie-wb-common by kiegroup.
the class ArchetypeServiceImpl method validate.
@Override
public void validate(final String alias) {
checkNotEmpty(ALIAS_PARAM, alias);
final Repository repository = resolveRepository(alias);
if (repository == null) {
throw new IllegalStateException(String.format("Repository %s cannot be resolved.", alias));
}
validateArchetype(repository);
archetypePreferencesManager.addArchetype(alias);
archetypeListUpdatedEvent.fire(new ArchetypeListUpdatedEvent(ArchetypeListOperation.VALIDATE));
}
use of org.kie.workbench.common.screens.archetype.mgmt.shared.events.ArchetypeListUpdatedEvent in project kie-wb-common by kiegroup.
the class AbstractArchetypeTablePresenterTest method onArchetypeListUpdatedEventWhenIsNotSetupTest.
@Test
public void onArchetypeListUpdatedEventWhenIsNotSetupTest() {
setPresenterPrivateField("setup", false);
presenter.onArchetypeListUpdatedEvent(new ArchetypeListUpdatedEvent(ArchetypeListOperation.ADD));
verify(archetypeService, never()).list(any(), any(), any());
}
use of org.kie.workbench.common.screens.archetype.mgmt.shared.events.ArchetypeListUpdatedEvent in project kie-wb-common by kiegroup.
the class AbstractArchetypeTablePresenterTest method onArchetypeListUpdatedEventWhenIsSetupTest.
@Test
public void onArchetypeListUpdatedEventWhenIsSetupTest() {
setPresenterPrivateField("setup", true);
doReturn(promises.resolve()).when(presenter).loadList(false);
presenter.onArchetypeListUpdatedEvent(new ArchetypeListUpdatedEvent(ArchetypeListOperation.ADD));
verify(presenter).loadList(false);
}
Aggregations