use of org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallWorkItems.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallWorkItems() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_SERVICE_TASKS);
assertDiagram(diagram, 5);
// Email service task assertions.
Node<? extends Definition, ?> emailNode = diagram.getGraph().getNode("_277CE006-5E6E-4960-A68C-CC8A5347C33F");
assertTrue(emailNode.getContent().getDefinition() instanceof ServiceTask);
ServiceTask email = (ServiceTask) emailNode.getContent().getDefinition();
assertEquals(WorkItemDefinitionMockRegistry.EMAIL.getName(), email.getName());
assertEquals(WorkItemDefinitionMockRegistry.EMAIL.getCategory(), email.getCategory());
assertEquals(WorkItemDefinitionMockRegistry.EMAIL.getDefaultHandler(), email.getDefaultHandler());
assertEquals(WorkItemDefinitionMockRegistry.EMAIL.getDescription(), email.getDescription());
assertEquals(WorkItemDefinitionMockRegistry.EMAIL.getDisplayName(), email.getGeneral().getName().getValue());
assertEquals(WorkItemDefinitionMockRegistry.EMAIL.getDocumentation(), email.getGeneral().getDocumentation().getValue());
// Log service task assertions.
Node<? extends Definition, ?> logNode = diagram.getGraph().getNode("_A940748F-A658-4FB8-84FD-B69F4B7A9205");
assertTrue(logNode.getContent().getDefinition() instanceof ServiceTask);
ServiceTask log = (ServiceTask) logNode.getContent().getDefinition();
assertEquals(WorkItemDefinitionMockRegistry.LOG.getName(), log.getName());
assertEquals(WorkItemDefinitionMockRegistry.LOG.getCategory(), log.getCategory());
assertEquals(WorkItemDefinitionMockRegistry.LOG.getDefaultHandler(), log.getDefaultHandler());
assertEquals(WorkItemDefinitionMockRegistry.LOG.getDescription(), log.getDescription());
assertEquals(WorkItemDefinitionMockRegistry.LOG.getDisplayName(), log.getGeneral().getName().getValue());
assertEquals(WorkItemDefinitionMockRegistry.LOG.getDocumentation(), log.getGeneral().getDocumentation().getValue());
}
Aggregations