use of org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype in project kie-wb-common by kiegroup.
the class LibraryServiceImpl method createProject.
@Override
public WorkspaceProject createProject(final OrganizationalUnit organizationalUnit, final String remoteRepositoryUrl, final String repositoryAlias) {
final String projectName = repositoryAlias != null ? repositoryAlias : DEFAULT_PROJECT_NAME;
final Optional<Archetype> baseArchetype = archetypeService.getBaseKieArchetype();
final String baseArchetypeAlias = baseArchetype.map(Archetype::getAlias).orElse(null);
final GAV gav = createGAV(projectName, organizationalUnit);
final POM pom = createPOM(projectName, projectName, gav);
return createProject(organizationalUnit, pom, DeploymentMode.VALIDATED, baseArchetypeAlias, remoteRepositoryUrl);
}
use of org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype in project kie-wb-common by kiegroup.
the class AbstractArchetypeTablePresenterTest method finishLoadListTest.
@Test
public void finishLoadListTest() {
final List<Archetype> archetypes = new ArrayList<>();
archetypes.add(createArchetypeWithAlias("archetype 1"));
archetypes.add(createArchetypeWithAlias("archetype 2"));
archetypes.add(createArchetypeWithAlias("archetype 3"));
final Map<String, Boolean> selectionMap = new HashMap<>();
selectionMap.put("archetype 1", true);
selectionMap.put("archetype 2", true);
selectionMap.put("archetype 3", true);
final PaginatedArchetypeList paginatedArchetypeList = new PaginatedArchetypeList(archetypes, 0, 10, 3);
doReturn(selectionMap).when(archetypePreferences).getArchetypeSelectionMap();
doReturn("archetype 1").when(archetypePreferences).getDefaultSelection();
presenter.finishLoadList(paginatedArchetypeList);
verify(archetypeListPresenter).setup(any(), any(), any());
verify(view).setSelectionCounter(Mockito.<String>any());
verify(busyIndicatorView).hideBusyIndicator();
verify(view).show(true);
}
use of org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype in project kie-wb-common by kiegroup.
the class ArchetypeItemPresenterTest method setupWhenHideDefaultBadgeTest.
@Test
public void setupWhenHideDefaultBadgeTest() {
final Archetype archetype = createArchetypeWithStatus(ArchetypeStatus.VALID);
final ArchetypeItem archetypeItem = new ArchetypeItem(archetype, true, false);
presenter.setup(archetypeItem, tablePresenter);
verify(view).showDefaultBadge(false);
}
use of org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype in project kie-wb-common by kiegroup.
the class ArchetypeItemPresenterTest method makeDefaultWhenIsNotValidTest.
@Test
public void makeDefaultWhenIsNotValidTest() {
final Archetype archetype = createArchetypeWithStatus(ArchetypeStatus.INVALID);
final ArchetypeItem archetypeItem = new ArchetypeItem(archetype, true, true);
doReturn(true).when(tablePresenter).canMakeChanges();
presenter.setup(archetypeItem, tablePresenter);
presenter.makeDefault();
verify(presenter, never()).setIncluded(true);
verify(tablePresenter, never()).makeDefaultValue(any(), anyBoolean());
}
use of org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype in project kie-wb-common by kiegroup.
the class ArchetypeItemPresenterTest method setupWhenDisableIncludeTest.
@Test
public void setupWhenDisableIncludeTest() {
final Archetype archetype = createArchetypeWithStatus(ArchetypeStatus.INVALID);
final ArchetypeItem archetypeItem = new ArchetypeItem(archetype, true, true);
presenter.setup(archetypeItem, tablePresenter);
verify(view).enableIncludeCheckbox(false);
}
Aggregations