Search in sources :

Example 6 with ArchetypeItem

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);
}
Also used : Archetype(org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype) ArchetypeItem(org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem) Test(org.junit.Test)

Example 7 with ArchetypeItem

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());
}
Also used : ArchetypeItem(org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem) Test(org.junit.Test)

Example 8 with ArchetypeItem

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());
}
Also used : Archetype(org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype) ArchetypeItem(org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem) Test(org.junit.Test)

Example 9 with ArchetypeItem

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());
}
Also used : Archetype(org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype) ArchetypeItem(org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)9 ArchetypeItem (org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem)9 Archetype (org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype)8