使用Junit测试Controller类时出现了service无法自动注入,空指针异常问题。

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zy1104560031/article/details/84255550

使用Junit测试Controller类时出现了service与controller出现空指针异常问题,但是运行主函数可正常注入。

@Autowired

@Resouce

@Controller

@Service

@RequestMapper(...)

猜你喜欢

转载自blog.csdn.net/zy1104560031/article/details/84255550