support #I3CT01 帮liteflow增加单元测试

This commit is contained in:
徐佳
2021-04-06 16:58:04 +08:00
parent 7d385e02a1
commit 90b797a6f2
7 changed files with 25 additions and 7 deletions

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}

View File

@@ -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">

View File

@@ -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"}
]
},
{

View File

@@ -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>

View File

@@ -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'