use of org.kie.workbench.common.stunner.bpmn.definition.DataObject 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.DataObject in project kie-wb-common by kiegroup.
the class AssignmentsEditorWidgetTest method testDataObjectsNewLine.
@Test
public void testDataObjectsNewLine() {
DataObject dataObject = new DataObject();
dataObject.getName().setValue("Data\nObject");
String doNameFilter = widget.dataObjectToProcessVariableFormat(dataObject);
assertEquals(doNameFilter, "DataObject:Object");
}
Aggregations