mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-21 03:48:10 +08:00
support #I3CT01 帮liteflow增加单元测试
This commit is contained in:
@@ -34,6 +34,6 @@ public class SubflowJsonSpringBootTest {
|
||||
public void testExplicitSubFlow() throws Exception {
|
||||
LiteflowResponse<Slot> response = flowExecutor.execute("chain1", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a", response.getData().printStep());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getData().printStep());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,6 @@ public class SubflowXMLSpringBootTest {
|
||||
public void testExplicitSubFlow() throws Exception {
|
||||
LiteflowResponse<Slot> response = flowExecutor.execute("chain1", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a", response.getData().printStep());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getData().printStep());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SubflowYmlSpringBootTest {
|
||||
public void testExplicitSubFlowYml() throws Exception {
|
||||
LiteflowResponse<Slot> response = flowExecutor.execute("chain1", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a", response.getData().printStep());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getData().printStep());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<chain name="chain3">
|
||||
<then value="f,g"/> <!-- f隐式调用chain4 -->
|
||||
<then value="f,g"/> <!-- g隐式调用chain4 -->
|
||||
</chain>
|
||||
|
||||
<chain name="chain4">
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
{
|
||||
"flow": {
|
||||
"chain": [
|
||||
{
|
||||
"name": "chain3",
|
||||
"condition": [
|
||||
{"type": "then", "value": "e,d"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "chain2",
|
||||
"condition": [
|
||||
{"type": "then", "value": "b,a"}
|
||||
{"type": "then", "value": "b,a"},
|
||||
{"type": "then", "value": "chain3"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
|
||||
<chain name="chain2">
|
||||
<then value="b,a"/>
|
||||
<then value="chain3"/>
|
||||
</chain>
|
||||
<!-- a,b,c,b,a -->
|
||||
|
||||
<chain name="chain3">
|
||||
<then value="e,d"/>
|
||||
</chain>
|
||||
<!-- a,b,c,b,a,e,d -->
|
||||
</flow>
|
||||
@@ -1,5 +1,9 @@
|
||||
flow:
|
||||
chain:
|
||||
- name: chain3
|
||||
condition:
|
||||
- type: then
|
||||
value: 'e,d'
|
||||
- name: chain1
|
||||
condition:
|
||||
- type: then
|
||||
@@ -15,4 +19,6 @@ flow:
|
||||
- name: chain2
|
||||
condition:
|
||||
- type: then
|
||||
value: 'b,a'
|
||||
value: 'b,a'
|
||||
- type: then
|
||||
value: 'chain3'
|
||||
Reference in New Issue
Block a user