use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes in project kie-wb-common by kiegroup.
the class ProcessPropertyWriterTest method testSetMetaData.
@Test
public void testSetMetaData() {
MetaDataAttributes metaDataAttributes = new MetaDataAttributes("att1ßval1Øatt2ßval2");
p.setMetaData(metaDataAttributes);
String metaDataString = CustomElement.metaDataAttributes.of(p.getProcess()).get();
assertThat(metaDataString).isEqualTo("att1ß<![CDATA[val1]]>Øatt2ß<![CDATA[val2]]>");
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes in project kie-wb-common by kiegroup.
the class ProcessPropertyWriterTest method testSetMetaDataEmpty.
@Test
public void testSetMetaDataEmpty() {
MetaDataAttributes metaDataAttributes = mock(MetaDataAttributes.class);
when(metaDataAttributes.getValue()).thenReturn("");
p.setMetaData(metaDataAttributes);
String metaDataString = CustomElement.metaDataAttributes.of(p.getProcess()).get();
assertThat(metaDataString).isEqualTo("");
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes in project kie-wb-common by kiegroup.
the class ProcessPropertyWriterTest method testSetMetaDataNull.
@Test
public void testSetMetaDataNull() {
MetaDataAttributes metaDataAttributes = mock(MetaDataAttributes.class);
when(metaDataAttributes.getValue()).thenReturn(null);
p.setMetaData(metaDataAttributes);
String metaDataString = CustomElement.metaDataAttributes.of(p.getProcess()).get();
assertThat(metaDataString).isEqualTo("");
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes in project kie-wb-common by kiegroup.
the class TaskConverterPriorityTest method setPriorityEscapeSpecialChars.
@Test
public void setPriorityEscapeSpecialChars() {
propertyWriterFactory = new PropertyWriterFactory();
taskConverter = spy(new TaskConverter(propertyWriterFactory));
when(n.getContent()).thenReturn(view);
when(view.getBounds()).thenReturn(Bounds.create(0, 0, 10, 10));
when(view.getDefinition()).thenReturn(definition);
when(general.getName()).thenReturn(new Name("Name"));
when(general.getDocumentation()).thenReturn(new Documentation());
when(definition.getGeneral()).thenReturn(general);
when(definition.getSimulationSet()).thenReturn(new SimulationSet());
when(definition.getExecutionSet()).thenReturn(baseUserTaskExecutionSet);
when(baseUserTaskExecutionSet.getTaskName()).thenReturn(new TaskName("taskName"));
when(baseUserTaskExecutionSet.getActors()).thenReturn(new Actors());
when(baseUserTaskExecutionSet.getAssignmentsinfo()).thenReturn(new AssignmentsInfo());
when(baseUserTaskExecutionSet.getReassignmentsInfo()).thenReturn(new ReassignmentsInfo());
when(baseUserTaskExecutionSet.getNotificationsInfo()).thenReturn(new NotificationsInfo());
when(baseUserTaskExecutionSet.getSkippable()).thenReturn(new Skippable(true));
when(baseUserTaskExecutionSet.getGroupid()).thenReturn(new Groupid("groupId"));
when(baseUserTaskExecutionSet.getSubject()).thenReturn(new Subject());
when(baseUserTaskExecutionSet.getDescription()).thenReturn(new Description());
when(baseUserTaskExecutionSet.getPriority()).thenReturn(new TaskPriority("#{varOne<>&\"}"));
when(baseUserTaskExecutionSet.getIsAsync()).thenReturn(new IsAsync(true));
when(baseUserTaskExecutionSet.getCreatedBy()).thenReturn(new CreatedBy());
when(baseUserTaskExecutionSet.getAdHocAutostart()).thenReturn(new AdHocAutostart());
when(baseUserTaskExecutionSet.getIsMultipleInstance()).thenReturn(new IsMultipleInstance(false));
when(baseUserTaskExecutionSet.getOnEntryAction()).thenReturn(new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getOnExitAction()).thenReturn(new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getContent()).thenReturn(new Content());
when(baseUserTaskExecutionSet.getSlaDueDate()).thenReturn(new SLADueDate());
when(definition.getAdvancedData()).thenReturn(new AdvancedData(new MetaDataAttributes()));
doCallRealMethod().when(taskConverter).userTask(any());
final UserTaskPropertyWriter propertyWriter = (UserTaskPropertyWriter) taskConverter.userTask(n);
assertTrue(propertyWriter.getPriority().equals("<![CDATA[#{varOne<>&"}]]>"));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes in project kie-wb-common by kiegroup.
the class BPMNDiagramTest method testSetAdvancedData.
@Test
public void testSetAdvancedData() {
BPMNDiagramImpl BPMNDiagramImpl = createValidBpmnDiagram();
BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
RootProcessAdvancedData advancedData = new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA));
assertEquals(advancedData, BPMNDiagramImpl.getAdvancedData());
assertEquals(advancedData.getGlobalVariables(), BPMNDiagramImpl.getAdvancedData().getGlobalVariables());
assertEquals(advancedData.getMetaDataAttributes(), BPMNDiagramImpl.getAdvancedData().getMetaDataAttributes());
}
Aggregations