springboot2.0.5+junit4.12+mockito+powermock单元测试静态类型出现- org.mockito.exceptions.Reporter

问题:使用springboot2.0.5+junit4.12+mockito+powermock单元测试静态类型出现- org.mockito.exceptions.Reporter

解决方案:

mockito版本使用springboot默认的2.15.0,此时若使用powermock-api-mockito的1.7.X都不能报错,即版本不兼容。mockito2.X版本需使用powermock-api-mockito2版本。

    2.0.0-RC.3


   org.powermock
   powermock-api-mockito2
   ${powermock.version}
   test
  

  
   org.powermock
   powermock-module-junit4
   ${powermock.version}
   test
  

  
            org.powermock
            powermock-classloading-xstream
            ${powermock.version}
       

       
            org.powermock
            powermock-module-junit4-rule
            ${powermock.version}
       

       
            org.powermock
            powermock-api-support
            ${powermock.version}
       

你可能感兴趣的:(Q&A)