mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
增加switch的测试用例
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user