PowerMockito: got InvalidUseOfMatchersException when use matchers mocking static method

前端 未结 4 883
遥遥无期
遥遥无期 2021-01-18 10:33

When I\'m testing this static method

public class SomeClass {
    public static long someMethod(Map map, String string, Long l, Log log) {
        ...
    }
         


        
4条回答
  •  星月不相逢
    2021-01-18 11:04

    
            org.mockito
            mockito-all
            ${mockito.version}
        
        
            org.powermock
            powermock-module-junit4
            ${powermock.version}
            jar
            provided
        
        
            org.powermock
            powermock-api-mockito
            ${powermock.version}
            jar
            provided
        
    

    I hope your project is using maven. Try including these jars to the build.

提交回复
热议问题