mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 04:02:09 +08:00
增加tag的测试用例
This commit is contained in:
@@ -20,6 +20,7 @@ import javax.annotation.Resource;
|
||||
@TestPropertySource(value = "classpath:/tag/application.properties")
|
||||
@SpringBootTest(classes = ScriptJavaxProTagTest.class)
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({ "com.yomahub.liteflow.test.script.javapro.tag.aspect" })
|
||||
public class ScriptJavaxProTagTest extends BaseTest {
|
||||
|
||||
@Resource
|
||||
@@ -28,7 +29,7 @@ public class ScriptJavaxProTagTest extends BaseTest {
|
||||
// 测试同id的节点在when场景中tag是否正常
|
||||
@Test
|
||||
public void testTag1() throws Exception {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
for (int i = 0; i < 1; i++) {
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
DefaultContext context = response.getFirstContextBean();
|
||||
Assertions.assertTrue(response.isSuccess());
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yomahub.liteflow.test.script.javapro.tag.aspect;
|
||||
|
||||
import com.yomahub.liteflow.aop.ICmpAroundAspect;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class GlobalAspect implements ICmpAroundAspect {
|
||||
@Override
|
||||
public void beforeProcess(NodeComponent cmp) {
|
||||
System.out.println("组件" + cmp.getNodeId() + ",切面获取的tag:" + cmp.getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterProcess(NodeComponent cmp) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(NodeComponent cmp) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(NodeComponent cmp, Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user