This commit is contained in:
2023-03-09 21:56:34 +08:00
parent 50bd645ec5
commit 93689dc7d0
20 changed files with 319 additions and 8 deletions

View File

@@ -5,17 +5,21 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
/**
* @RunWith(设置运行器)
* @ContextConfiguration(classes)
*/
@SpringBootTest
class Springboot04JunitApplicationTests {
//1.注入你要测试的对象
@Autowired
private BookDao bookDao;
//1.注入你要测试的对象
@Autowired
private BookDao bookDao;
@Test
void contextLoads() {
//2.执行要测试的对象对应的方法
bookDao.save();
}
@Test
void contextLoads() {
//2.执行要测试的对象对应的方法
bookDao.save();
}
}