Search in sources :

Example 6 with ExampleProjectWidget

use of org.kie.workbench.common.screens.library.client.widgets.example.ExampleProjectWidget in project kie-wb-common by kiegroup.

the class ExampleImportPresenterTest method setup.

@Before
public void setup() {
    libraryServiceCaller = new CallerMock<>(libraryService);
    examplesServiceCaller = new CallerMock<>(examplesService);
    tileWidget = spy(new ExampleProjectWidget(mock(ExampleProjectWidget.View.class), exampleProjectOkPresenter, exampleProjectErrorPresenter, branchSelectorPopUpPresenter));
    doReturn("space1").when(organizationalUnit).getName();
    doReturn(tileWidget).when(tileWidgets).get();
    doAnswer(invocationOnMock -> spy(new ExampleProjectWidget(mock(ExampleProjectWidget.View.class), exampleProjectOkPresenter, exampleProjectErrorPresenter, branchSelectorPopUpPresenter))).when(tileWidgets).get();
    importPresenter = spy(new ExamplesImportPresenter(view, libraryPlaces, tileWidgets, examplesServiceCaller, mock(WorkspaceProjectContext.class), notificationEvent, projectContextChangeEvent, new Elemental2DomUtil(), mock(TranslationService.class), importProjectsPreferences, libraryServiceCaller));
    doReturn(organizationalUnit).when(importPresenter).activeOrganizationalUnit();
}
Also used : TranslationService(org.jboss.errai.ui.client.local.spi.TranslationService) Elemental2DomUtil(org.jboss.errai.common.client.dom.elemental2.Elemental2DomUtil) WorkspaceProjectContext(org.guvnor.common.services.project.client.context.WorkspaceProjectContext) ExampleProjectWidget(org.kie.workbench.common.screens.library.client.widgets.example.ExampleProjectWidget) Before(org.junit.Before)

Aggregations

ExampleProjectWidget (org.kie.workbench.common.screens.library.client.widgets.example.ExampleProjectWidget)6 Test (org.junit.Test)3 ImportProject (org.kie.workbench.common.screens.examples.model.ImportProject)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)1 WorkspaceProjectContext (org.guvnor.common.services.project.client.context.WorkspaceProjectContext)1 Elemental2DomUtil (org.jboss.errai.common.client.dom.elemental2.Elemental2DomUtil)1 TranslationService (org.jboss.errai.ui.client.local.spi.TranslationService)1 Before (org.junit.Before)1 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)1 DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)1