Escritura de prueba unitaria SpringBoot
@RunWith(SpringRunner.class)
@SpringBootTest
public class Test {
@Test
public void test() {
System.out.println("单元测试");
}
}
Dependencias de pom requeridas
<!--SpringBoot单元测试-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>