Search in sources :

Example 1 with CopyPopUpPresenter

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

the class CopyPopupWithPackageViewTest method setup.

@Before
public void setup() {
    final CopyPopUpPresenter presenter = mock(CopyPopUpPresenter.class);
    doReturn(PathFactory.newPath("my-file.txt", "my-project/src/main/resources/my-file.txt")).when(presenter).getPath();
    copyView = spy(new CopyPopupWithPackageView());
    copyView.presenter = presenter;
    copyView.packageListBox = mock(PackageListBox.class);
    copyView.translationService = mock(TranslationService.class);
    doReturn(mock(Package.class)).when(copyView.packageListBox).getSelectedPackage();
    doReturn(mock(Button.class)).when(copyView).button(anyString(), any(Command.class), any(ButtonType.class));
    packageLoadedCommandCaptor = ArgumentCaptor.forClass(Command.class);
    doNothing().when(copyView.packageListBox).setUp(eq(true), packageLoadedCommandCaptor.capture());
}
Also used : CopyPopUpPresenter(org.uberfire.ext.editor.commons.client.file.popups.CopyPopUpPresenter) PackageListBox(org.kie.workbench.common.widgets.client.handlers.PackageListBox) TranslationService(org.jboss.errai.ui.client.local.spi.TranslationService) Button(org.gwtbootstrap3.client.ui.Button) Command(org.uberfire.mvp.Command) Package(org.guvnor.common.services.project.model.Package) ButtonType(org.gwtbootstrap3.client.ui.constants.ButtonType) Before(org.junit.Before)

Aggregations

Package (org.guvnor.common.services.project.model.Package)1 Button (org.gwtbootstrap3.client.ui.Button)1 ButtonType (org.gwtbootstrap3.client.ui.constants.ButtonType)1 TranslationService (org.jboss.errai.ui.client.local.spi.TranslationService)1 Before (org.junit.Before)1 PackageListBox (org.kie.workbench.common.widgets.client.handlers.PackageListBox)1 CopyPopUpPresenter (org.uberfire.ext.editor.commons.client.file.popups.CopyPopUpPresenter)1 Command (org.uberfire.mvp.Command)1