瀏覽代碼

2021年6月9日-增加单元测试类

zhujinghui 4 年之前
父節點
當前提交
bb33a08e42

+ 0 - 2
fcb-project-application/src/main/resources/application-dev.properties

@@ -1,6 +1,4 @@
 
-server.port=8285
-
 #注册中心
 spring.cloud.nacos.discovery.server-addr=8.135.98.231:8848
 spring.cloud.nacos.discovery.namespace=31b3ac3b-ba06-4be7-9cbf-69a8df190dfe

+ 0 - 2
fcb-project-application/src/main/resources/application-prod.properties

@@ -1,6 +1,4 @@
 
-server.port=8285
-
 #nacos 注册中心
 spring.cloud.nacos.discovery.server-addr=10.71.9.205:80
 

+ 1 - 1
fcb-project-application/src/main/resources/application-test.properties

@@ -1,5 +1,5 @@
 
-server.port=8285
+
 #server.port=8385
 
 #注册中心

+ 0 - 1
fcb-project-application/src/main/resources/application-uat.properties

@@ -1,5 +1,4 @@
 
-server.port=8285
 #server.port=8385
 
 #注册中心

+ 1 - 0
fcb-project-application/src/main/resources/application.properties

@@ -1,4 +1,5 @@
 
+server.port=8285
 
 #spring.profiles.active=prod
 spring.profiles.active=dev

+ 27 - 0
fcb-project-application/src/test/java/fcb/project/manager/TestController.java

@@ -0,0 +1,27 @@
+package fcb.project.manager;
+
+import lombok.SneakyThrows;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = FcbProjectManagerApplication.class)
+@AutoConfigureMockMvc
+public class TestController {
+
+
+    /**
+     * 单元测试
+     */
+    @Test
+    @SneakyThrows
+    public void test() {
+        String a = null;
+        Assert.assertTrue("a为空",a != null);
+    }
+
+}

+ 9 - 1
pom.xml

@@ -55,11 +55,12 @@
 
 
     <dependencies>
+
         <!-- 引入四维sdk -->
         <dependency>
             <groupId>org.4dage</groupId>
             <artifactId>4dage-back-sdk</artifactId>
-            <version>1.0.3.0-RELEASE</version>
+            <version>1.0.3.1-SNAPSHOT</version>
             <exclusions>
                 <exclusion>
                     <groupId>io.lettuce</groupId>
@@ -99,6 +100,13 @@
                 </exclusion>
             </exclusions>
         </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
         <!-- mybatis-plus逻辑删除依赖-->
         <dependency>
             <groupId>com.baomidou</groupId>