Junit 5
dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
useage
shortcut key ctrl+shift+t
in IDEA will create a new test in test scope folder
@SpringBootTest
class TestControllerTest {
@Autowired
private TestController testController;
@Test
public void test1() {
testController.testQuery();
}
}
Junit 4
to be continue