use of org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem in project kie-wb-common by kiegroup.
the class ArchetypeItemPresenterTest method setupWhenIsNotIncludedTest.
@Test
public void setupWhenIsNotIncludedTest() {
final Archetype archetype = createArchetypeWithStatus(ArchetypeStatus.VALID);
final ArchetypeItem archetypeItem = new ArchetypeItem(archetype, false, true);
presenter.setup(archetypeItem, tablePresenter);
verify(view).setIncluded(false);
}
use of org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem in project kie-wb-common by kiegroup.
the class ArchetypeItemPresenterTest method getObjectTest.
@Test
public void getObjectTest() {
final ArchetypeItem archetypeItem = createArchetypeItem();
presenter.setup(archetypeItem, tablePresenter);
assertEquals(archetypeItem, presenter.getObject());
}
use of org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem in project kie-wb-common by kiegroup.
the class ArchetypeItemPresenterTest method setIncludedWhenIsNotValidTest.
@Test
public void setIncludedWhenIsNotValidTest() {
final Archetype archetype = createArchetypeWithStatus(ArchetypeStatus.INVALID);
final ArchetypeItem archetypeItem = new ArchetypeItem(archetype, true, true);
doReturn(true).when(tablePresenter).canMakeChanges();
presenter.setup(archetypeItem, tablePresenter);
presenter.setIncluded(true);
verify(view, never()).checkIncluded(anyBoolean());
verify(tablePresenter, never()).setSelected(any(), anyBoolean());
}
use of org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem in project kie-wb-common by kiegroup.
the class ArchetypeItemPresenterTest method setupWhenAllEnabledTest.
@Test
public void setupWhenAllEnabledTest() {
final Archetype archetype = createArchetypeWithStatus(ArchetypeStatus.VALID);
final ArchetypeItem archetypeItem = new ArchetypeItem(archetype, true, true);
doReturn(true).when(tablePresenter).isShowIncludeColumn();
doReturn(true).when(tablePresenter).isShowStatusColumn();
doReturn(true).when(tablePresenter).isShowDeleteAction();
doReturn(true).when(tablePresenter).isShowValidateAction();
presenter.setup(archetypeItem, tablePresenter);
verify(view).init(presenter);
verify(view).setIncluded(archetypeItem.isSelected());
verify(view).setGroupId(archetype.getGav().getGroupId());
verify(view).setArtifactId(archetype.getGav().getArtifactId());
verify(view).setVersion(archetype.getGav().getVersion());
verify(view).setCreatedDate(ArchetypeItemPresenter.DATE_FORMAT.format(archetype.getCreatedDate()));
verify(view).showInclude(true);
verify(view).showStatus(true);
verify(view).showDeleteAction(true);
verify(view).showValidateAction(true);
verify(view).showDefaultBadge(true);
verify(view).enableIncludeCheckbox(true);
verify(view).enableSetDefault(true);
verify(view).setDeleteCommand(any());
verify(view).setDefaultBadgeTooltip(Mockito.<String>any());
}
Aggregations