use of org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue in project kie-wb-common by kiegroup.
the class VariableProviderTest method testViewAndContent.
@Test
public void testViewAndContent() {
Node<View<DataObject>, ?> dataObjectNode;
DataObject dataObject = new DataObject();
dataObject.getGeneral().getDocumentation().setValue("doc");
dataObject.setName(new Name("name"));
dataObject.setType(new DataObjectType(new DataObjectTypeValue("name")));
dataObjectNode = new NodeImpl<>(UUID.uuid());
dataObjectNode.setContent(dataObjectView);
when(dataObjectView.getDefinition()).thenReturn(dataObject);
boolean isBPMNDefinition = ((VariablesProvider) provider).isBPMNDefinition(dataObjectNode);
assertTrue(" Must be a BPMN Definition", isBPMNDefinition);
Node<View<Object>, ?> objectNode = new NodeImpl<>(UUID.uuid());
objectNode.setContent(otherView);
when(otherView.getDefinition()).thenReturn(new Object());
isBPMNDefinition = ((VariablesProvider) provider).isBPMNDefinition(objectNode);
assertFalse(" Must not be a BPMN Definition", isBPMNDefinition);
Node<Element, ?> objectNode2 = new NodeImpl<>(UUID.uuid());
Element someElement = mock(Element.class);
objectNode2.setContent(someElement);
isBPMNDefinition = ((VariablesProvider) provider).isBPMNDefinition(objectNode2);
assertFalse(" Must not be a BPMN Definition", isBPMNDefinition);
}
Aggregations