use of org.kie.workbench.common.stunner.core.client.ManagedInstanceStub in project kie-wb-common by kiegroup.
the class StunnerEditorTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() {
sessionEditorPresenters = spy(new ManagedInstanceStub<>(sessionEditorPresenter));
sessionViewerPresenters = spy(new ManagedInstanceStub<>(sessionViewerPresenter));
when(sessionEditorPresenter.getView()).thenReturn(sessionPresenterView);
when(sessionViewerPresenter.getView()).thenReturn(sessionPresenterView);
when(sessionEditorPresenter.getInstance()).thenReturn(editorSession);
when(sessionViewerPresenter.getInstance()).thenReturn(viewerSession);
when(sessionEditorPresenter.getHandler()).thenReturn(canvasHandler);
when(sessionViewerPresenter.getHandler()).thenReturn(canvasHandler);
xmlEditorViews = spy(new ManagedInstanceStub<>(xmlEditorView));
when(xmlEditorView.asWidget()).thenReturn(xmlEditorViewWidget);
Metadata metadata = new MetadataImpl.MetadataImplBuilder("testSet").build();
diagram = new DiagramImpl("testDiagram", mock(Graph.class), metadata);
when(editorSession.getCanvasHandler()).thenReturn(canvasHandler);
when(viewerSession.getCanvasHandler()).thenReturn(canvasHandler);
when(canvasHandler.getDiagram()).thenReturn(diagram);
tested = new StunnerEditor(sessionEditorPresenters, sessionViewerPresenters, translationService, xmlEditorViews, errorPopupPresenter, view);
}
use of org.kie.workbench.common.stunner.core.client.ManagedInstanceStub in project kie-wb-common by kiegroup.
the class StunnerBPMNEntryPointTest method setUp.
@Before
public void setUp() throws Exception {
diagramDef = new BPMNDiagramImpl();
when(bpmnDiagramFilterProvider.getDefinitionType()).thenReturn((Class) BPMNDiagramImpl.class);
intermediateEventDef = new IntermediateTimerEvent();
when(catchingIntermediateEventFilterProvider.getDefinitionType()).thenReturn((Class) IntermediateTimerEvent.class);
startEventDef = new StartNoneEvent();
when(startEventFilterProvider.getDefinitionType()).thenReturn((Class) StartNoneEvent.class);
managedFilters = new ManagedInstanceStub(bpmnDiagramFilterProvider, startEventFilterProvider, catchingIntermediateEventFilterProvider);
tested = new StunnerBPMNEntryPoint(sessionManager, managedFilters);
}
Aggregations