@@ -86,15 +86,48 @@ void givenYaml_whenParsing_thenReturnFlowObject() {
8686 assertEquals ("host" , step2Docker .getNetwork ());
8787 }
8888
89+ @ Test
90+ void givenYamlWithParallelSteps_whenParsing_thenReturnFlowObject () {
91+ var content = getResourceAsString ("yaml/v2_success_parallel_steps.yaml" );
92+ var flowV2 = parseYamlV2 .invoke (content );
93+ assertNotNull (flowV2 );
94+
95+ // next steps of flow should be the steps without deps
96+ var next = flowV2 .next (null );
97+ assertEquals (2 , next .size ());
98+ assertEquals ("step_abc" , next .get (0 ).getName ());
99+ assertEquals ("step_1" , next .get (1 ).getName ());
100+
101+ next = flowV2 .next ("step_1" );
102+ assertEquals (2 , next .size ());
103+ assertEquals ("step_2_A_1" , next .get (0 ).getName ());
104+ assertEquals ("step_2_B" , next .get (1 ).getName ());
105+
106+ next = flowV2 .next ("step_2_A_1" );
107+ assertEquals (1 , next .size ());
108+ assertEquals ("step_2_A_2" , next .getFirst ().getName ());
109+
110+ next = flowV2 .next ("step_2_A_2" );
111+ assertEquals (1 , next .size ());
112+ assertEquals ("step_3" , next .getFirst ().getName ());
113+
114+ next = flowV2 .next ("step_2_B" );
115+ assertEquals (1 , next .size ());
116+ assertEquals ("step_3" , next .getFirst ().getName ());
117+
118+ next = flowV2 .next ("step_3" );
119+ assertEquals (0 , next .size ());
120+ }
121+
89122 @ ParameterizedTest
90123 @ CsvSource ({
91124 "v2_step_name_invalid.yaml,step name 'step 1' is invalid" ,
92125 "v2_step_name_duplicate.yaml,step name 'step_1' already exists" ,
93126 "v2_step_depends_on_not_found.yaml,depends on 'step_not_there' is not found" ,
94127 "v2_commands_missing.yaml,at least one command under step 'step_1' is required" ,
95128 "v2_commands_without_script.yaml,bash or powershell is required" ,
96- "v2_circular_dependency_on_all_depends.yaml,circular dependency found" ,
97- "v2_circular_dependency_with_separate_step.yaml,circular dependency found" ,
129+ "v2_circular_dependency_on_all_depends.yaml,circular dependency found on step: step_d " ,
130+ "v2_circular_dependency_with_separate_step.yaml,circular dependency found on step: step_c " ,
98131 })
99132 void givenInvalidYaml_whenParsing_thenThrowException (String yamlFile , String expectedMsg ) {
100133 var content = getResourceAsString ("yaml/" + yamlFile );
0 commit comments