Skip to content

Commit bd7d01c

Browse files
committed
fix ymlservice unit test
1 parent e46dc3b commit bd7d01c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

core/src/test/java/com/flowci/core/test/flow/YmlServiceTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,16 @@ public class YmlServiceTest extends SpringScenario {
4646
private Flow flow;
4747

4848
@Before
49-
public void login() {
49+
public void login() throws IOException {
5050
mockLogin();
51-
flow = flowService.create("hello", new CreateOption());
51+
var raw = StringHelper.toString(load("flow.yml"));
52+
var option = new CreateOption().setRawYaml(StringHelper.toBase64(raw));
53+
flow = flowService.create("hello", option);
5254
}
5355

5456
@Test
55-
public void should_save_yml_for_flow() throws IOException {
56-
// when:
57-
String ymlRaw = StringHelper.toString(load("flow.yml"));
58-
59-
// then: yml object should be created
60-
Yml yml = ymlService.saveYml(flow, Yml.DEFAULT_NAME, ymlRaw);
57+
public void should_get_yml() {
58+
Yml yml = ymlService.getYml(flow.getId(), Yml.DEFAULT_NAME);
6159
Assert.assertNotNull(yml);
6260

6361
Assert.assertNotNull(yml.getId());

0 commit comments

Comments
 (0)