use of org.kie.workbench.common.stunner.core.client.shape.factory.ShapeDefFunctionalFactory in project kie-wb-common by kiegroup.
the class CaseManagementShapeDefFactoryTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
this.pictureShapeView = new PictureShapeView(new MultiPath().rect(0, 0, 10, 10));
when(stageView.setWidth(anyDouble())).thenReturn(stageView);
when(stageView.setHeight(anyDouble())).thenReturn(stageView);
when(basicShapeViewFactory.pictureFromUri(any(SafeUri.class), anyDouble(), anyDouble())).thenReturn(pictureShapeView);
when(basicShapeViewFactory.connector(anyDouble(), anyDouble(), anyDouble(), anyDouble())).thenReturn(connectorShapeView);
when(cmShapeViewFactory.newNullView()).thenReturn(nullView);
when(cmShapeViewFactory.newStageView(anyDouble(), anyDouble(), anyDouble())).thenReturn(stageView);
when(cmShapeViewFactory.newActivityView(anyDouble(), anyDouble())).thenReturn(activityView);
when(cmShapeViewFactory.newDiagramView(anyDouble(), anyDouble())).thenReturn(diagramView);
this.tested = new CaseManagementShapeDefFactory(cmShapeViewFactory, basicShapeViewFactory, new ShapeDefFunctionalFactory<>());
this.tested.init();
}
use of org.kie.workbench.common.stunner.core.client.shape.factory.ShapeDefFunctionalFactory in project kie-wb-common by kiegroup.
the class SVGShapeFactoryTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
this.functionalFactory = new ShapeDefFunctionalFactory();
this.tested = spy(new SVGShapeFactory(beanManager, functionalFactory));
this.tested.init();
when(svgShapeDef.getViewFactoryType()).thenReturn(Object.class);
when(svgMutableShapeDef.getViewFactoryType()).thenReturn(Object.class);
when(svgMutableShapeDef.titleHandler()).thenReturn(Optional.empty());
when(svgMutableShapeDef.fontHandler()).thenReturn(Optional.empty());
when(svgMutableShapeDef.sizeHandler()).thenReturn(Optional.empty());
when(svgMutableShapeDef.viewHandler()).thenReturn(viewHandler);
when(shapeView.getShapeStateHandler()).thenReturn(shapeViewStateHandler);
when(shapeViewImpl.getShapeStateHandler()).thenReturn(shapeViewImplStateHandler);
doAnswer(invocationOnMock -> SVGShapeDef.class).when(svgShapeDef).getType();
doAnswer(invocationOnMock -> SVGShapeViewDef.class).when(svgMutableShapeDef).getType();
doAnswer(invocationOnMock -> shapeView).when(svgShapeDef).newViewInstance(eq(viewFactory), any(Object.class));
doAnswer(invocationOnMock -> shapeViewImpl).when(svgMutableShapeDef).newViewInstance(eq(viewFactory), any(Object.class));
}
Aggregations