SpringBoot使用注解注入mapper报错Find why ‘xxxMapper‘ could be null

SpringBoot使用注解注入mapper报错Find why ‘xxxMapper’ could be null解决方案

创建测试类插入数据

但是报错

image-20220910185141954

image-20220910184951593

原来junit用的是4版本的

image-20220910185204517

junit-jupiter5的@Test注解

image-20220910185303494

再次运行就成功了

成功运行

image-20220910185022523


版权声明:本文为qq_46110710原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。