WorkflowDefinition parsedDefinition = converter.readWorkflowDefinition(baos.toByteArray());
// Check if parsed definition matches the original one
assertEquals(workflowDefinition.getName(), parsedDefinition.getName());
assertEquals(workflowDefinition.getDescription(), parsedDefinition.getDescription());
ParallelStepsDefinition parallelDef = null;
for (StepDefinition step : parsedDefinition.getSteps()) {
if (step instanceof ParallelStepsDefinition) {
parallelDef = (ParallelStepsDefinition) step;
}
}
assertNotNull(parallelDef);
assertEquals(2, parallelDef.getStepList().size());
ListStepDefinition<ParallelStepsDefinition> listSteps = parallelDef.getStepList().get(0);
assertEquals(2, listSteps.getSteps().size());
listSteps = parallelDef.getStepList().get(1);
assertEquals(1, listSteps.getSteps().size());
}