use of org.kie.workbench.common.stunner.client.lienzo.components.glyph.ShapeGlyphDragHandler in project kie-wb-common by kiegroup.
the class DecisionComponentsItemViewTest method testDecisionComponentItemMouseDown.
@Test
public void testDecisionComponentItemMouseDown() {
final MouseDownEvent mouseDownEvent = mock(MouseDownEvent.class);
final Callback proxy = mock(Callback.class);
final DRGElement drgElement = mock(DRGElement.class);
final DMNShapeFactory factory = mock(DMNShapeFactory.class);
final ShapeGlyphDragHandler.Item item = mock(ShapeGlyphDragHandler.Item.class);
final Glyph glyph = mock(Glyph.class);
final int x = 10;
final int y = 20;
when(dmnShapeSet.getShapeFactory()).thenReturn(factory);
when(presenter.getDrgElement()).thenReturn(drgElement);
when(factory.getGlyph(any())).thenReturn(glyph);
when(mouseDownEvent.getX()).thenReturn(x);
when(mouseDownEvent.getY()).thenReturn(y);
doReturn(proxy).when(view).makeDragProxyCallbackImpl(drgElement, factory);
doReturn(item).when(view).makeDragHandler(glyph);
view.decisionComponentItemMouseDown(mouseDownEvent);
verify(shapeGlyphDragHandler).show(item, x, y, proxy);
}
Aggregations