Search in sources :

Example 6 with Archetype

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);
}
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 Archetype

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());
}
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 8 with Archetype

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);
}
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 Archetype

use of org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype in project kie-wb-common by kiegroup.

the class ArchetypeItemPresenterTest method setupWhenInvalidStatusTest.

@Test
public void setupWhenInvalidStatusTest() {
    final Archetype archetype = createArchetypeWithStatus(ArchetypeStatus.INVALID);
    final ArchetypeItem archetypeItem = new ArchetypeItem(archetype, true, true);
    presenter.setup(archetypeItem, tablePresenter);
    verify(view).enableIncludeCheckbox(false);
    verify(view).enableSetDefault(false);
    verify(view).showValidStatus(false);
    verify(view).showInvalidStatus(true);
    verify(view).setInvalidTooltip(Mockito.<String>any());
    verify(view, never()).setValidTooltip(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)

Example 10 with Archetype

use of org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype in project kie-wb-common by kiegroup.

the class ArchetypeItemPresenterTest method setupWhenDisableSetDefaultTest.

@Test
public void setupWhenDisableSetDefaultTest() {
    final Archetype archetype = createArchetypeWithStatus(ArchetypeStatus.INVALID);
    final ArchetypeItem archetypeItem = new ArchetypeItem(archetype, true, true);
    presenter.setup(archetypeItem, tablePresenter);
    verify(view).enableSetDefault(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)

Aggregations

Archetype (org.kie.workbench.common.screens.archetype.mgmt.shared.model.Archetype)38 Test (org.junit.Test)31 Repository (org.guvnor.structure.repositories.Repository)14 GitRepository (org.guvnor.structure.repositories.impl.git.GitRepository)13 ArrayList (java.util.ArrayList)8 ArchetypeItem (org.kie.workbench.common.screens.archetype.mgmt.client.table.item.model.ArchetypeItem)8 PaginatedArchetypeList (org.kie.workbench.common.screens.archetype.mgmt.shared.model.PaginatedArchetypeList)7 Path (org.uberfire.java.nio.file.Path)5 GAV (org.guvnor.common.services.project.model.GAV)3 POM (org.guvnor.common.services.project.model.POM)2 ArchetypeListUpdatedEvent (org.kie.workbench.common.screens.archetype.mgmt.shared.events.ArchetypeListUpdatedEvent)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 File (java.io.File)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 List (java.util.List)1 BiFunction (java.util.function.BiFunction)1 Function (java.util.function.Function)1