Browse Source

优化test

zhouhao 6 years ago
parent
commit
a526154fef

+ 5 - 5
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/test/java/org/hswebframework/web/workflow/dimension/DefaultCandidateDimensionParserTest.groovy

@@ -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

+ 0 - 57
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/test/java/org/hswebframework/web/workflow/flowable/ControllerTest.java

@@ -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);
-                }
-            };
-        }
-    }
-}

+ 1 - 0
hsweb-system/pom.xml

@@ -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>