mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-08 08:54:07 +08:00
优化test
This commit is contained in:
@@ -23,7 +23,7 @@ class DefaultCandidateDimensionParserTest extends Specification {
|
||||
setup:
|
||||
def config = """ {"type":"user","idList":["admin"]} """
|
||||
and:
|
||||
def dimension = parser.parse(config)
|
||||
def dimension = parser.parse(null,config)
|
||||
expect:
|
||||
dimension != null
|
||||
dimension.getCandidateUserIdList() != null
|
||||
@@ -35,7 +35,7 @@ class DefaultCandidateDimensionParserTest extends Specification {
|
||||
setup:
|
||||
def config = """ {"type":"role","idList":["admin"]} """
|
||||
and:
|
||||
def dimension = parser.parse(config)
|
||||
def dimension = parser.parse(null,config)
|
||||
expect:
|
||||
dimension != null
|
||||
dimension.getCandidateUserIdList() != null
|
||||
@@ -47,7 +47,7 @@ class DefaultCandidateDimensionParserTest extends Specification {
|
||||
setup:
|
||||
def config = """ {"type":"position","idList":["test"],"tree":"parent"} """
|
||||
and:
|
||||
def dimension = parser.parse(config)
|
||||
def dimension = parser.parse(null,config)
|
||||
expect:
|
||||
dimension != null
|
||||
dimension.getCandidateUserIdList() != null
|
||||
@@ -58,7 +58,7 @@ class DefaultCandidateDimensionParserTest extends Specification {
|
||||
setup:
|
||||
def config = """ {"type":"department","idList":["test"]} """
|
||||
and:
|
||||
def dimension = parser.parse(config)
|
||||
def dimension = parser.parse(null,config)
|
||||
expect:
|
||||
dimension != null
|
||||
dimension.getCandidateUserIdList() != null
|
||||
@@ -69,7 +69,7 @@ class DefaultCandidateDimensionParserTest extends Specification {
|
||||
setup:
|
||||
def config = """ {"type":"org","idList":["test"]} """
|
||||
and:
|
||||
def dimension = parser.parse(config)
|
||||
def dimension = parser.parse(null,config)
|
||||
expect:
|
||||
dimension != null
|
||||
dimension.getCandidateUserIdList() != null
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package org.hswebframework.web.workflow.flowable;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.activiti.engine.impl.interceptor.SessionFactory;
|
||||
import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer;
|
||||
import org.hswebframework.web.tests.SimpleWebApplicationTests;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author wangwei
|
||||
* @Date 2017/8/1.
|
||||
*/
|
||||
@Configuration
|
||||
@ComponentScan("org.hswebframework.web.workflow")
|
||||
public class ControllerTest extends SimpleWebApplicationTests {
|
||||
|
||||
@Test
|
||||
public void testRest() throws Exception {
|
||||
//todo 获取所有可办理流程
|
||||
JSONObject result = testGet("/workflow/process/definition").exec().resultAsJson();
|
||||
Assert.assertNotNull( result.getJSONObject("result"));
|
||||
Assert.assertEquals(200, result.get("status"));
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
public static class config {
|
||||
@Autowired(required = false)
|
||||
private List<SessionFactory> sessionFactories;
|
||||
|
||||
@Bean
|
||||
public ProcessEngineConfigurationConfigurer processEngineConfigurationConfigurer() {
|
||||
return configuration -> {
|
||||
configuration
|
||||
.setAsyncExecutorActivate(false)
|
||||
.setJobExecutorActivate(false)
|
||||
.setDatabaseSchemaUpdate("false")
|
||||
.setActivityFontName("宋体")
|
||||
.setLabelFontName("宋体")
|
||||
.setAnnotationFontName("宋体");
|
||||
|
||||
if (sessionFactories != null) {
|
||||
configuration.setCustomSessionFactories(sessionFactories);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
<artifactId>hsweb-framework</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0.0-RC-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user