@@ -72,13 +72,14 @@ public class CmdManagerTest extends MockLoggedInScenario {
7272 @ Test
7373 public void should_apply_flow_level_docker_option () throws IOException {
7474 // given: flow and job
75- Flow flow = flowService .create ("hello" , new CreateOption ());
76- String yaml = StringHelper .toString (load ("flow-with-root-docker.yml" ));
77- Yml ymlObj = ymlService .saveYml (flow , Yml .DEFAULT_NAME , yaml );
78- Job job = jobService .create (flow , ymlObj .getRaw (), Job .Trigger .MANUAL , new StringVars ());
75+ var yaml = StringHelper .toString (load ("flow-with-root-docker.yml" ));
76+ var option = new CreateOption ().setRawYaml (StringHelper .toBase64 (yaml ));
77+ Flow flow = flowService .create ("hello" , option );
78+
79+ Job job = jobService .create (flow , yaml , Job .Trigger .MANUAL , new StringVars ());
7980 Assert .assertNotNull (job );
8081
81- FlowNode root = YmlParser .load (ymlObj . getRaw () );
82+ FlowNode root = YmlParser .load (yaml );
8283 NodeTree tree = NodeTree .create (root );
8384
8485 // when: create first shell cmd
@@ -111,15 +112,15 @@ public void should_create_cmd_in_with_default_plugin_value() throws IOException
111112 Mockito .when (eventManager .publish (Mockito .any ())).thenReturn (event );
112113
113114 // given: flow and job
114- Flow flow = flowService . create ( "hello" , new CreateOption ( ));
115- String yaml = StringHelper . toString ( load ( "flow-with-plugin.yml" ));
116- Yml yml = ymlService . saveYml ( flow , Yml . DEFAULT_NAME , yaml );
115+ var yaml = StringHelper . toString ( load ( "flow-with-plugin.yml" ));
116+ var option = new CreateOption (). setRawYaml ( StringHelper . toBase64 ( yaml ));
117+ var flow = flowService . create ( "hello" , option );
117118
118- Job job = jobService .create (flow , yml . getRaw () , Job .Trigger .MANUAL , new StringVars ());
119+ Job job = jobService .create (flow , yaml , Job .Trigger .MANUAL , new StringVars ());
119120 Assert .assertNotNull (job );
120121
121122 // when: create shell cmd
122- FlowNode root = YmlParser .load (yml . getRaw () );
123+ FlowNode root = YmlParser .load (yaml );
123124 NodeTree tree = NodeTree .create (root );
124125 Node node = tree .get (NodePath .create (DEFAULT_ROOT_NAME , "plugin-test" ));
125126 Step step = stepService .get (job .getId (), node .getPath ().getPathInStr ());
@@ -149,15 +150,15 @@ public void should_create_cmd_in_with_default_plugin_value() throws IOException
149150 @ Test
150151 public void should_handle_step_in_step () throws IOException {
151152 // given: flow and job
152- Flow flow = flowService . create ( "hello" , new CreateOption ( ));
153- String yaml = StringHelper . toString ( load ( "step-in-step.yml" ));
154- Yml yml = ymlService . saveYml ( flow , Yml . DEFAULT_NAME , yaml );
153+ var yaml = StringHelper . toString ( load ( "step-in-step.yml" ));
154+ var option = new CreateOption (). setRawYaml ( StringHelper . toBase64 ( yaml ));
155+ var flow = flowService . create ( "hello" , option );
155156
156- Job job = jobService .create (flow , yml . getRaw () , Job .Trigger .MANUAL , new StringVars ());
157+ Job job = jobService .create (flow , yaml , Job .Trigger .MANUAL , new StringVars ());
157158 Assert .assertNotNull (job );
158159
159160 // when: create shell cmd
160- FlowNode root = YmlParser .load (yml . getRaw () );
161+ FlowNode root = YmlParser .load (yaml );
161162 NodeTree tree = NodeTree .create (root );
162163
163164 Node step2_1 = tree .get (NodePath .create (DEFAULT_ROOT_NAME , "step2" , "step-2-1" ));
0 commit comments