Commit 2815db1e by lixinyi

增加单元测试

parent ebdfba7c
...@@ -58,6 +58,14 @@ ...@@ -58,6 +58,14 @@
<properties> <properties>
<package.environment>test</package.environment> <package.environment>test</package.environment>
<jar.version>-TEST</jar.version> <jar.version>-TEST</jar.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Sonar -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.itReportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.itReportPath>
<sonar.language>java</sonar.language>
</properties> </properties>
</profile> </profile>
<profile> <profile>
...@@ -81,7 +89,46 @@ ...@@ -81,7 +89,46 @@
</repositories> </repositories>
<build> <build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
</plugin>
</plugins>
</pluginManagement>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>target/jacoco.exec</dataFile>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>--> <!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>--> <!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>--> <!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
......
import com.brilliance.hk.EurekaServerApplication;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest(classes = EurekaServerApplication.class)
public class Test {
@org.junit.jupiter.api.Test
public void testJacoco01(){
System.out.println("success");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment