@Before public void setUp() throws Exception { tested = new CaseManagementSvgSubprocessShapeDef(); SVGShapeViewResource subcase = mock(SVGShapeViewResource.class); when(factory.subcase()).thenReturn(subcase); SVGShapeViewResource subprocess = mock(SVGShapeViewResource.class); when(factory.subprocess()).thenReturn(subprocess); }
@Override public SVGShapeView<?> newViewInstance(final CaseManagementSVGViewFactory factory, final BaseCaseManagementReusableSubprocess bean) { return newViewInstance(Optional.ofNullable(bean.getDimensionsSet().getWidth()), Optional.ofNullable(bean.getDimensionsSet().getHeight()), VIEW_RESOURCES.getResource(factory, bean)); }
@Test public void testGetGlyph() throws Exception { Glyph subcaseGlyph = tested.getGlyph(CaseReusableSubprocess.class, ""); assertEquals(CaseManagementSVGGlyphFactory.SUBCASE_GLYPH, subcaseGlyph); Glyph subprocessGlyph = tested.getGlyph(ProcessReusableSubprocess.class, ""); assertEquals(CaseManagementSVGGlyphFactory.SUBPROCESS_GLYPH, subprocessGlyph); } }
@Override public FontHandler<BaseCaseManagementReusableSubprocess, SVGShapeView> newFontHandler() { return newFontHandlerBuilder() .position(CaseManagementSvgSubprocessShapeDef::getSubprocessTextPosition) .build(); }
@Override public SizeHandler<BaseCaseManagementReusableSubprocess, SVGShapeView> newSizeHandler() { return newSizeHandlerBuilder() .width(e -> e.getDimensionsSet().getWidth().getValue()) .height(e -> e.getDimensionsSet().getHeight().getValue()) .minWidth(e -> 50d) .minHeight(e -> 50d) .build(); }
() -> shapeDefFactory) .delegate(ProcessReusableSubprocess.class, new CaseManagementSvgSubprocessShapeDef(), () -> shapeDefFactory) .delegate(CaseReusableSubprocess.class, new CaseManagementSvgSubprocessShapeDef(), () -> shapeDefFactory) .delegate(UserTask.class,
@Test public void testNewViewInstance() throws Exception { tested.newViewInstance(factory, new CaseReusableSubprocess()); verify(factory, times(1)).subcase(); tested.newViewInstance(factory, new ProcessReusableSubprocess()); verify(factory, times(1)).subprocess(); }