Search in sources :

Example 6 with FileNameAndCommitMessage

use of org.uberfire.ext.editor.commons.client.file.FileNameAndCommitMessage in project kie-wb-common by kiegroup.

the class ProjectScreenTest method testDuplicateCommand.

@Test
public void testDuplicateCommand() {
    doNothing().when(projectScreenService).copy(any(), any());
    final CopyPopUpView copyPopUpView = mock(CopyPopUpView.class);
    doReturn(copyPopUpView).when(copyPopUpPresenter).getView();
    this.presenter.getDuplicateCommand().execute(new FileNameAndCommitMessage("newFileName", "commitMessage"));
    verify(copyPopUpView).hide();
    verify(view).showBusyIndicator(anyString());
    verify(projectScreenService).copy(presenter.workspaceProject, "newFileName");
    verify(view).hideBusyIndicator();
    verify(notificationEvent).fire(any());
    verify(promises).resolve();
}
Also used : FileNameAndCommitMessage(org.uberfire.ext.editor.commons.client.file.FileNameAndCommitMessage) CommandWithFileNameAndCommitMessage(org.uberfire.ext.editor.commons.client.file.CommandWithFileNameAndCommitMessage) CopyPopUpView(org.uberfire.ext.editor.commons.client.file.popups.CopyPopUpView) Test(org.junit.Test)

Aggregations

CommandWithFileNameAndCommitMessage (org.uberfire.ext.editor.commons.client.file.CommandWithFileNameAndCommitMessage)6 FileNameAndCommitMessage (org.uberfire.ext.editor.commons.client.file.FileNameAndCommitMessage)6 Path (org.uberfire.backend.vfs.Path)3 Validator (org.uberfire.ext.editor.commons.client.validation.Validator)3 Test (org.junit.Test)2 FormModelerContent (org.kie.workbench.common.forms.editor.model.FormModelerContent)1 DataObject (org.kie.workbench.common.services.datamodeller.core.DataObject)1 CopyPopUpView (org.uberfire.ext.editor.commons.client.file.popups.CopyPopUpView)1 ValidatorCallback (org.uberfire.ext.editor.commons.client.validation.ValidatorCallback)1