SpringBoot整合Junit
使用步骤
搭建SpringBoot工程
引入starter-test起步依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
编写测试类
package com.wt.demo17.service;
import org.springframework.stereotype.Service;
@Service
public class UserService {
public void add(