use of org.kie.workbench.common.stunner.core.client.shape.MutationContext in project kie-wb-common by kiegroup.
the class SessionPreviewCanvasHandlerProxyTest method checkApplyElementMutationDelegatesToWrapped.
@Test
public void checkApplyElementMutationDelegatesToWrapped() {
final Shape shape = mock(Shape.class);
final Element candidate = mock(Element.class);
final boolean applyPosition = true;
final boolean applyProperties = false;
final MutationContext mutationContext = mock(MutationContext.class);
proxy.applyElementMutation(shape, candidate, applyPosition, applyProperties, mutationContext);
verify(wrapped).applyElementMutation(eq(shape), eq(candidate), eq(applyPosition), eq(applyProperties), eq(mutationContext));
proxy.applyElementMutation(candidate, mutationContext);
verify(wrapped).applyElementMutation(eq(candidate), eq(mutationContext));
proxy.applyElementMutation(candidate, applyPosition, applyProperties, mutationContext);
verify(wrapped).applyElementMutation(eq(candidate), eq(applyPosition), eq(applyProperties), eq(mutationContext));
}
use of org.kie.workbench.common.stunner.core.client.shape.MutationContext in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandlerTest method checkApplyElementMutationRenderableShapes.
@Test
@SuppressWarnings("unchecked")
public void checkApplyElementMutationRenderableShapes() {
final ActivityShape shape = spy(makeShape());
final Node<View<BPMNViewDefinition>, Edge> node = makeNode("uuid", shape);
final MutationContext mutationContext = mock(MutationContext.class);
doNothing().when(shape).applyPosition(eq(node), eq(mutationContext));
doNothing().when(shape).applyProperties(eq(node), eq(mutationContext));
doNothing().when(shape).applyTitle(anyString(), any(Node.class), eq(mutationContext));
handler.applyElementMutation(shape, node, true, true, mutationContext);
verify(shape, times(1)).applyPosition(eq(node), eq(mutationContext));
verify(shape, times(1)).applyProperties(eq(node), eq(mutationContext));
verify(canvas, times(1)).draw();
}
use of org.kie.workbench.common.stunner.core.client.shape.MutationContext in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandlerTest method checkApplyShapeElementMutationRenderableShapes.
@Test
@SuppressWarnings("unchecked")
public void checkApplyShapeElementMutationRenderableShapes() {
final ActivityShape shape = spy(makeShape());
final Node<View<BPMNViewDefinition>, Edge> node = makeNode("uuid", shape);
final MutationContext mutationContext = mock(MutationContext.class);
doNothing().when(shape).applyPosition(eq(node), eq(mutationContext));
doNothing().when(shape).applyProperties(eq(node), eq(mutationContext));
doNothing().when(shape).applyTitle(anyString(), any(Node.class), eq(mutationContext));
handler.register(shape, node, true);
verify(canvas, times(1)).draw();
handler.applyElementMutation(node, true, true, mutationContext);
verify(shape, times(1)).applyPosition(eq(node), eq(mutationContext));
verify(shape, times(1)).applyProperties(eq(node), eq(mutationContext));
verify(canvas, times(2)).draw();
}
use of org.kie.workbench.common.stunner.core.client.shape.MutationContext in project kie-wb-common by kiegroup.
the class BaseCanvasHandlerTest method testApplyMutation.
@Test
@SuppressWarnings("unchecked")
public void testApplyMutation() {
final MutationContext mutationContext = MutationContext.STATIC;
tested.applyElementMutation(shape, candidate, true, true, mutationContext);
verify(shape, times(1)).applyPosition(eq(candidate), eq(mutationContext));
verify(shape, times(1)).applyProperties(eq(candidate), eq(mutationContext));
verify(canvas, times(1)).draw();
}
use of org.kie.workbench.common.stunner.core.client.shape.MutationContext in project kie-wb-common by kiegroup.
the class SessionPreviewCanvasHandlerProxyTest method updateElementPropertiesDelegatesToWrapped.
@Test
public void updateElementPropertiesDelegatesToWrapped() {
final Element candidate = mock(Element.class);
final MutationContext mutationContext = mock(MutationContext.class);
proxy.updateElementProperties(candidate, mutationContext);
verify(wrapped).updateElementProperties(eq(candidate), eq(mutationContext));
}
Aggregations