- public static void main(String[] args) {
- Integer b = null;
- Integer a = false ? 0 : b;
- System.out.println("a = " + a);
- }
第二行报空指针异常
单元测试
使用mockito写单元测试,使用spring boot test, mockito mvc写集成测试
1. mockito理解
Mockito 3.6.0 中文文档 - ChangingFond
2. spring boot test使用SpringBoot——学会使用Test,检测自己写的代码_我是一棵卷心菜的博客-CSDN博客_springboot testcase