use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class GroupItemTest method testNoNeedToHide.
@Test
public void testNoNeedToHide() {
when(group.getAlpha()).thenReturn(0d);
final Command before = mock(Command.class);
final Command after = mock(Command.class);
tested.hide(before, after);
verify(before, never()).execute();
verify(showExecutor, never()).accept(any(Group.class), any(Command.class));
verify(hideExecutor, never()).accept(any(Group.class), any(Command.class));
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class GroupItemTest method testNoNeedToShow.
@Test
public void testNoNeedToShow() {
when(group.getAlpha()).thenReturn(1d);
final Command before = mock(Command.class);
final Command after = mock(Command.class);
tested.show(before, after);
verify(before, never()).execute();
verify(showExecutor, never()).accept(any(Group.class), any(Command.class));
verify(hideExecutor, never()).accept(any(Group.class), any(Command.class));
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class GroupItemTest method testShow.
@Test
public void testShow() {
when(group.getAlpha()).thenReturn(0d);
final Command before = mock(Command.class);
final Command after = mock(Command.class);
tested.show(before, after);
verify(before, times(1)).execute();
verify(showExecutor, times(1)).accept(eq(group), eq(after));
verify(hideExecutor, never()).accept(any(Group.class), any(Command.class));
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ButtonGridItemImplTest method testHide.
@Test
public void testHide() {
final Command before = mock(Command.class);
final Command after = mock(Command.class);
tested.hide(before, after);
verify(toolbox, times(1)).hide(any(Command.class), any(Command.class));
verify(toolbox, never()).show(any(Command.class), any(Command.class));
verify(button, times(1)).hide();
verify(button, never()).show(any(Command.class), any(Command.class));
verify(before, times(1)).execute();
verify(after, times(1)).execute();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ButtonItemImplTest method testHide.
@Test
public void testHide() {
final Command before = mock(Command.class);
final Command after = mock(Command.class);
tested.hide(before, after);
verify(groupItem, times(1)).hide(any(Command.class), eq(after));
verify(groupItem, never()).show(any(Command.class), any(Command.class));
verify(before, times(1)).execute();
verify(after, times(1)).execute();
}
Aggregations