加入fallback的一个测试用例

This commit is contained in:
everywhere.z
2024-01-11 15:50:33 +08:00
parent 143481632c
commit 5c0693ac04
2 changed files with 18 additions and 0 deletions

View File

@@ -19,6 +19,12 @@
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>liteflow-el-builder</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>

View File

@@ -1,5 +1,8 @@
package com.yomahub.liteflow.test.fallback;
import com.yomahub.liteflow.builder.el.ELBus;
import com.yomahub.liteflow.builder.el.ELWrapper;
import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import com.yomahub.liteflow.test.BaseTest;
@@ -222,4 +225,13 @@ public class FallbackELSpringbootTest extends BaseTest {
String stepStr2 = response2.getExecuteStepStrWithoutTime();
Assertions.assertTrue("c==>ifn2".equals(stepStr2) || "ifn2==>c".equals(stepStr2));
}
@Test
public void testWithElBuild(){
ELWrapper el = ELBus.then("a", "b", "az");
LiteFlowChainELBuilder.createChain().setChainId("elBuilder").setEL(el.toEL()).build();
LiteflowResponse response = flowExecutor.execute2Resp("elBuilder");
Assertions.assertTrue(response.isSuccess());
Assertions.assertEquals("a==>b==>c", response.getExecuteStepStrWithoutTime());
}
}