Search in sources :

Example 1 with AfterEditOrganizationalUnitEvent

use of org.guvnor.structure.events.AfterEditOrganizationalUnitEvent in project kie-wb-common by kiegroup.

the class LibraryScreenTest method organizationalUnitEditedTest.

@Test
public void organizationalUnitEditedTest() {
    final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
    final List<String> contributors = new ArrayList<>();
    contributors.add("admin");
    doReturn(contributors).when(organizationalUnit).getContributors();
    libraryScreen.organizationalUnitEdited(new AfterEditOrganizationalUnitEvent(mock(OrganizationalUnit.class), organizationalUnit));
    verify(view).setContributorsCount(contributors.size());
}
Also used : OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) AfterEditOrganizationalUnitEvent(org.guvnor.structure.events.AfterEditOrganizationalUnitEvent) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 2 with AfterEditOrganizationalUnitEvent

use of org.guvnor.structure.events.AfterEditOrganizationalUnitEvent in project kie-wb-common by kiegroup.

the class ContributorsListPresenterTest method organizationalUnitEditedTest.

@Test
public void organizationalUnitEditedTest() {
    final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
    final AfterEditOrganizationalUnitEvent afterEditOrganizationalUnitEvent = mock(AfterEditOrganizationalUnitEvent.class);
    doReturn(organizationalUnit).when(afterEditOrganizationalUnitEvent).getEditedOrganizationalUnit();
    when(projectContext.getActiveOrganizationalUnit()).thenReturn(Optional.of(organizationalUnit));
    presenter.organizationalUnitEdited(afterEditOrganizationalUnitEvent);
    verify(view).clearFilterText();
    verify(presenter).updateContributors(organizationalUnit);
}
Also used : OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) AfterEditOrganizationalUnitEvent(org.guvnor.structure.events.AfterEditOrganizationalUnitEvent) Test(org.junit.Test)

Aggregations

AfterEditOrganizationalUnitEvent (org.guvnor.structure.events.AfterEditOrganizationalUnitEvent)2 OrganizationalUnit (org.guvnor.structure.organizationalunit.OrganizationalUnit)2 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1