use of org.uberfire.mvp.Command in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphEditorPresenterTest method testGetSaveAndRenameCommand.
@Test
public void testGetSaveAndRenameCommand() {
final Command expectedCommand = mock(Command.class);
final GuidedDecisionTableGraphEditorPresenter presenter = makePresenter();
doReturn(saveAndRenameCommandBuilder).when(saveAndRenameCommandBuilder).addPathSupplier(any());
doReturn(saveAndRenameCommandBuilder).when(saveAndRenameCommandBuilder).addValidator(any(Validator.class));
doReturn(saveAndRenameCommandBuilder).when(saveAndRenameCommandBuilder).addValidator(any(Supplier.class));
doReturn(saveAndRenameCommandBuilder).when(saveAndRenameCommandBuilder).addRenameService(any());
doReturn(saveAndRenameCommandBuilder).when(saveAndRenameCommandBuilder).addMetadataSupplier(any());
doReturn(saveAndRenameCommandBuilder).when(saveAndRenameCommandBuilder).addContentSupplier(any());
doReturn(saveAndRenameCommandBuilder).when(saveAndRenameCommandBuilder).addIsDirtySupplier(any());
doReturn(saveAndRenameCommandBuilder).when(saveAndRenameCommandBuilder).addSuccessCallback(any());
doReturn(expectedCommand).when(saveAndRenameCommandBuilder).build();
final Command actualCommand = presenter.getSaveAndRenameCommand();
assertEquals(expectedCommand, actualCommand);
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class RelationGridTest method testOnItemSelected.
@Test
public void testOnItemSelected() {
setupGrid(0);
final Command command = mock(Command.class);
final HasListSelectorControl.ListSelectorTextItem listSelectorItem = mock(HasListSelectorControl.ListSelectorTextItem.class);
when(listSelectorItem.getCommand()).thenReturn(command);
grid.onItemSelected(listSelectorItem);
verify(command).execute();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class UndefinedExpressionGridTest method testOnItemSelected.
@Test
public void testOnItemSelected() {
setupGrid(0);
final Command command = mock(Command.class);
final ListSelectorTextItem listSelectorItem = mock(ListSelectorTextItem.class);
when(listSelectorItem.getCommand()).thenReturn(command);
grid.onItemSelected(listSelectorItem);
verify(command).execute();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testOnItemSelected.
@Test
public void testOnItemSelected() {
setupGrid(makeHasNameForDecision(), 0);
final Command command = mock(Command.class);
final HasListSelectorControl.ListSelectorTextItem listSelectorItem = mock(HasListSelectorControl.ListSelectorTextItem.class);
when(listSelectorItem.getCommand()).thenReturn(command);
grid.onItemSelected(listSelectorItem);
verify(command).execute();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class FunctionGridTest method testOnItemSelected.
@Test
public void testOnItemSelected() {
setupGrid(0);
final Command command = mock(Command.class);
final HasListSelectorControl.ListSelectorTextItem listSelectorItem = mock(HasListSelectorControl.ListSelectorTextItem.class);
when(listSelectorItem.getCommand()).thenReturn(command);
grid.onItemSelected(listSelectorItem);
verify(command).execute();
}
Aggregations