use of org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType in project kie-wb-common by kiegroup.
the class AssignmentsEditorWidgetProcessVariablesTest 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 = widget.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 = widget.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);
when(otherView.getDefinition()).thenReturn(new Object());
isBPMNDefinition = widget.isBPMNDefinition(objectNode2);
assertFalse(" Must not be a BPMN Definition", isBPMNDefinition);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType in project kie-wb-common by kiegroup.
the class VariableProviderTest method mockModes.
@Override
protected List<Element> mockModes() {
List<Element> nodes = new ArrayList<>();
nodes.add(mockRootNode(PROCESS_VARIABLES, CASE_FILE_VARIABLES));
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);
nodes.add(dataObjectNode);
return nodes;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType 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