增加switch的测试用例

This commit is contained in:
everywhere.z
2023-02-21 19:14:55 +08:00
parent a5c39f724c
commit 78b95b7a40
3 changed files with 36 additions and 0 deletions

View File

@@ -92,4 +92,12 @@ public class SwitchELSpringbootTest extends BaseTest {
Assert.assertEquals("a==>j==>d",response.getExecuteStepStr());
}
//测试跳转到某个链路上
@Test
public void testSwitch9() throws Exception{
LiteflowResponse response = flowExecutor.execute2Resp("chain9", "arg");
Assert.assertTrue(response.isSuccess());
Assert.assertEquals("k==>a==>b",response.getExecuteStepStr());
}
}

View File

@@ -0,0 +1,20 @@
/**
* <p>Title: liteflow</p>
* <p>Description: 轻量级的组件式流程框架</p>
* @author Tingliang Wang
* @email bytlwang@126.com
* @Date 2022/12/09
*/
package com.yomahub.liteflow.test.switchcase.cmp;
import com.yomahub.liteflow.core.NodeSwitchComponent;
import org.springframework.stereotype.Component;
@Component("k")
public class KSwitchCmp extends NodeSwitchComponent {
@Override
public String processSwitch() throws Exception {
return "chain10";
}
}

View File

@@ -56,4 +56,12 @@
SWITCH(j).to(b, c).DEFAULT(d)
);
</chain>
<chain name="chain9">
SWITCH(k).TO(a, chain10);
</chain>
<chain name="chain10">
THEN(a, b);
</chain>
</flow>