【测试用例】liteflow开启和关闭
This commit is contained in:
请叫我猿叔叔
2021-09-28 20:56:40 +08:00
parent 5cb2932188
commit 07e4909f7d
8 changed files with 177 additions and 3 deletions

View File

@@ -1,10 +1,14 @@
package com.yomahub.liteflow.test.enable;
import com.yomahub.liteflow.property.LiteflowConfig;
import com.yomahub.liteflow.test.BaseTest;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
@@ -12,6 +16,7 @@ import org.springframework.test.context.junit4.SpringRunner;
/**
* 测试springboot下的enable参数
*
* @author Bryan.Zhang
* @since 2.5.10
*/
@@ -22,8 +27,18 @@ import org.springframework.test.context.junit4.SpringRunner;
@ComponentScan({"com.yomahub.liteflow.test.enable.cmp"})
public class LiteflowEnableSpringbootTest extends BaseTest {
@Autowired
private ApplicationContext context;
@Test
public void testConfig() {
System.out.println("成功启动,并且打印");
public void testEnable() {
LiteflowConfig config = context.getBean(LiteflowConfig.class);
Boolean enable = config.getEnable();
if (enable) {
System.out.println("成功启动,并且打印");
return;
}
Assert.assertFalse(enable);
}
}

View File

@@ -1,2 +1,2 @@
liteflow.enable=false
liteflow.rule-source=enable/flow.xml
liteflow.rule-source=enable/flow.xml