From 1beab89c760223dec78b1acdb311ff127b225902 Mon Sep 17 00:00:00 2001 From: "dongguo.tao" Date: Wed, 7 Apr 2021 15:31:51 +0800 Subject: [PATCH] =?UTF-8?q?spring=E7=8E=AF=E5=A2=83=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D=E7=BD=AE=E6=BA=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomParserJsonSpringTest.java | 33 +++++++++++++++++++ .../CustomParserJsonSpringbootTest.java | 1 + .../resources/parsecustom/application.xml | 28 ++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringTest.java create mode 100644 liteflow-spring-boot-starter/src/test/resources/parsecustom/application.xml diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringTest.java new file mode 100644 index 000000000..f08974c1e --- /dev/null +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringTest.java @@ -0,0 +1,33 @@ +package com.yomahub.liteflow.test.parsecustom; + +import com.yomahub.liteflow.core.FlowExecutor; +import com.yomahub.liteflow.entity.data.LiteflowResponse; +import com.yomahub.liteflow.entity.data.Slot; +import com.yomahub.liteflow.test.BaseTest; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +/** + * spring环境的自定义json parser单元测试 + * @author dongguo.tao + * @since 2.5.0 + */ +@RunWith(SpringRunner.class) +@ContextConfiguration("classpath:/parsecustom/application.xml") +public class CustomParserJsonSpringTest extends BaseTest { + + @Resource + private FlowExecutor flowExecutor; + + //测试spring场景的自定义json parser + @Test + public void testSpringboot() throws Exception{ + LiteflowResponse response = flowExecutor.execute("chain1", "args"); + Assert.assertTrue(response.isSuccess()); + } +} diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java index 7e809ded6..99ad59116 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java @@ -17,6 +17,7 @@ import javax.annotation.Resource; /** * springboot环境的自定义json parser单元测试 + * @author dongguo.tao * @since 2.5.0 */ @RunWith(SpringRunner.class) diff --git a/liteflow-spring-boot-starter/src/test/resources/parsecustom/application.xml b/liteflow-spring-boot-starter/src/test/resources/parsecustom/application.xml new file mode 100644 index 000000000..904c8c80b --- /dev/null +++ b/liteflow-spring-boot-starter/src/test/resources/parsecustom/application.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file