java 1.8 Spring Boot 2.2.4 JUnit4
src
│ ├── main
│ │ └── Omitted
│ │
│ └── test
│ └── java
│ └── com
│ └── testTool
│ ├── TestToolApplicationTests.java
│ └── web
│ ├── controller
│ │ └── TestToolControllerTest.java
│ └── service
│ └── TestToolServiceTest.java
$ mvn test
command, all the java files under src / test would be executed.TestToolApplicationTests.java
was executed[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.028 s
[INFO] Finished at: 2020-05-27T15:42:18+09:00
[INFO] ------------------------------------------------------------------------
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--Add from here-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.22.0</version>
</dependency>
</dependencies>
<configuration>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</plugin>
<!--Add up to here-->
</plugins>
</build>
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.559 s
[INFO] Finished at: 2020-05-27T16:39:06+09:00
[INFO] ------------------------------------------------------------------------
Recommended Posts