mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 04:02:09 +08:00
enhancement #IBQCWB 对所有 EL 进行规范化后重新计算 MD5
This commit is contained in:
@@ -22,6 +22,7 @@ import com.yomahub.liteflow.log.LFLog;
|
|||||||
import com.yomahub.liteflow.log.LFLoggerManager;
|
import com.yomahub.liteflow.log.LFLoggerManager;
|
||||||
import com.yomahub.liteflow.slot.DataBus;
|
import com.yomahub.liteflow.slot.DataBus;
|
||||||
import com.yomahub.liteflow.slot.Slot;
|
import com.yomahub.liteflow.slot.Slot;
|
||||||
|
import com.yomahub.liteflow.util.ElRegexUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -245,7 +246,11 @@ public class Chain implements Executable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getElMd5() {
|
public String getElMd5() {
|
||||||
return elMd5 == null ? MD5.create().digestHex(el) : elMd5;
|
// 若为 null 时,先规范化 EL,再计算 MD5
|
||||||
|
if (elMd5 == null) {
|
||||||
|
elMd5 = MD5.create().digestHex(ElRegexUtil.normalize(el));
|
||||||
|
}
|
||||||
|
return elMd5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setElMd5(String elMd5) {
|
public void setElMd5(String elMd5) {
|
||||||
|
|||||||
@@ -89,4 +89,13 @@ public class BaseELSpringbootTest extends BaseTest {
|
|||||||
Assertions.assertNotEquals(response.getChainId(), response1.getChainId());
|
Assertions.assertNotEquals(response.getChainId(), response1.getChainId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 运行文件里同样的 chain
|
||||||
|
@Test
|
||||||
|
public void testBase8() throws Exception {
|
||||||
|
LiteflowResponse response = flowExecutor.execute2RespWithEL("THEN(a,b,SWITCH(e).to(d,f));");
|
||||||
|
Assertions.assertTrue(response.isSuccess());
|
||||||
|
// 应返回 chain2
|
||||||
|
Assertions.assertEquals("chain2", response.getChainId());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user