use of org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvas in project kie-wb-common by kiegroup.
the class CanvasDefinitionTooltipTest method testConfigure.
@Test
public void testConfigure() {
final AbstractCanvasHandler canvasHandler = mock(AbstractCanvasHandler.class);
final AbstractCanvas canvas = mock(AbstractCanvas.class);
final AbstractCanvas.View canvasView = mock(AbstractCanvas.View.class);
final Layer layer = mock(Layer.class);
final Transform transform = mock(Transform.class);
when(canvasHandler.getCanvas()).thenReturn(canvas);
when(canvasHandler.getAbstractCanvas()).thenReturn(canvas);
when(canvas.getLayer()).thenReturn(layer);
when(layer.getTransform()).thenReturn(transform);
when(canvas.getView()).thenReturn(canvasView);
when(canvasView.getAbsoluteX()).thenReturn(220d);
when(canvasView.getAbsoluteY()).thenReturn(50.5d);
final CanvasDefinitionTooltip t = tested.configure(canvasHandler);
assertEquals(tested, t);
verify(textTooltip, times(1)).setTransform(eq(transform));
final ArgumentCaptor<Point2D> pointCaptor = ArgumentCaptor.forClass(Point2D.class);
verify(textTooltip, times(1)).setCanvasLocation(pointCaptor.capture());
final Point2D point = pointCaptor.getValue();
assertEquals(220d, point.getX(), 0);
assertEquals(50.5d, point.getY(), 0);
}
use of org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvas in project kie-wb-common by kiegroup.
the class SessionPreviewCanvasHandlerProxyTest method checkHandleDelegatesToWrapped.
@Test
@SuppressWarnings("unchecked")
public void checkHandleDelegatesToWrapped() {
final AbstractCanvas canvas = mock(AbstractCanvas.class);
proxy.handle(canvas);
verify(wrapped).handle(eq(canvas));
}
Aggregations