@Test public void testMarshallNode_AdHocSubprocess() throws Exception { expectedStencil = "AdHocSubprocess"; tested.marshallNode(mock(FlowNode.class), new HashMap<>(), "AdHocSubprocess", mock(BPMNPlane.class), mock(JsonGenerator.class), 0.0f, 0.0f); }
@Test public void testMarshallNode_CaseReusableSubprocess() throws Exception { expectedStencil = "CaseReusableSubprocess"; final MetaDataType metaDataType = mock(MetaDataType.class); when(metaDataType.getName()).thenReturn("case"); when(metaDataType.getMetaValue()).thenReturn("true"); final FeatureMap featureMap = mock(FeatureMap.class); when(featureMap.get(eq(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA), eq(true))) .thenReturn(Collections.singletonList(metaDataType)); final ExtensionAttributeValue extensionAttributeValue = mock(ExtensionAttributeValue.class); when(extensionAttributeValue.getValue()).thenReturn(featureMap); final CallActivity callActivity = mock(CallActivity.class); when(callActivity.getExtensionValues()).thenReturn(Collections.singletonList(extensionAttributeValue)); tested.marshallNode(callActivity, new HashMap<>(), "ReusableSubprocess", mock(BPMNPlane.class), mock(JsonGenerator.class), 0.0f, 0.0f); }
@Test public void testMarshallNode_ProcessReusableSubprocess() throws Exception { expectedStencil = "ProcessReusableSubprocess"; final MetaDataType metaDataType = mock(MetaDataType.class); when(metaDataType.getName()).thenReturn("case"); when(metaDataType.getMetaValue()).thenReturn("false"); final FeatureMap featureMap = mock(FeatureMap.class); when(featureMap.get(eq(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA), eq(true))) .thenReturn(Collections.singletonList(metaDataType)); final ExtensionAttributeValue extensionAttributeValue = mock(ExtensionAttributeValue.class); when(extensionAttributeValue.getValue()).thenReturn(featureMap); final CallActivity callActivity = mock(CallActivity.class); when(callActivity.getExtensionValues()).thenReturn(Collections.singletonList(extensionAttributeValue)); tested.marshallNode(callActivity, new HashMap<>(), "ReusableSubprocess", mock(BPMNPlane.class), mock(JsonGenerator.class), 0.0f, 0.0f); } }