Junit test in idea SpringBoot cannot load @SpringApplicationConfiguration annotation



 

 

wrong reason:

 

    After the official Spring documentation, I found that it was SpringBootTestreplaced in the new version SpringApplicationConfiguration, so the Bean can be injected normally by changing the annotation to the following form

  

 after modification

   

   

 

 

 

 refer to:

   http://blog.csdn.net/u013360850/article/details/71075565

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326510036&siteId=291194637