mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 20:22:07 +08:00
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
liteflow.enable=false
|
||||
liteflow.rule-source=enable/flow.xml
|
||||
liteflow.rule-source=enable/flow.xml
|
||||
|
||||
Reference in New Issue
Block a user