How to mock SpringUtils.getBean(“beanName”) by Mockito.mockStatic(SpringUtils.class)

后端 未结 0 1130
忘了有多久
忘了有多久 2021-01-29 16:11

when I try to mock a static method likes SpringUtils.getBean("BeanName") with Mockito 3.7.7, , and I got a NullPointerException of applicationContext, and the getBean(

相关标签:
回答
  • 消灭零回复
提交回复
热议问题