diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELSpringbootTest2.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELSpringbootTest2.java
index 6d9bc5233..2d9114bda 100644
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELSpringbootTest2.java
+++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELSpringbootTest2.java
@@ -4,9 +4,8 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.util.CharsetUtil;
import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.exception.ChainNotFoundException;
import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.property.LiteflowConfig;
-import com.yomahub.liteflow.property.LiteflowConfigGetter;
import com.yomahub.liteflow.test.BaseTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
@@ -19,8 +18,6 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.TestPropertySource;
import javax.annotation.Resource;
-import java.io.File;
-import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -34,21 +31,22 @@ public class MonitorFileELSpringbootTest2 extends BaseTest {
@Resource
private FlowExecutor flowExecutor;
- // 测试监听新增文件
+ // 测试模糊路径下监听新增文件
@Test
public void testMonitorAddFile() throws Exception {
// 文件新增前
- LiteflowResponse liteflowResponse = flowExecutor.execute2Resp("chain2", "arg");
+ LiteflowResponse liteflowResponse = flowExecutor.execute2Resp("chain_add", "arg");
Assertions.assertFalse(liteflowResponse.isSuccess());
+ Assertions.assertTrue(liteflowResponse.getCause() instanceof ChainNotFoundException);
// 文件新增
String flowPath = new ClassPathResource("classpath:monitorFile").getAbsolutePath();
Path newFilePath = Paths.get(flowPath, "test", "flow.el.2.xml");
FileUtil.writeString("" +
- "THEN(a);",
+ "THEN(a);",
newFilePath.toFile(), CharsetUtil.CHARSET_UTF_8);
Thread.sleep(1000);
- liteflowResponse = flowExecutor.execute2Resp("chain2", "arg");
+ liteflowResponse = flowExecutor.execute2Resp("chain_add", "arg");
Assertions.assertTrue(liteflowResponse.isSuccess());
Assertions.assertEquals("a", liteflowResponse.getExecuteStepStr());
}