How do I mock a static method using PowerMockito?

后端 未结 1 589
春和景丽
春和景丽 2020-12-19 16:57

I am using:

    
        junit
        junit
        4.1         


        
相关标签:
1条回答
  • 2020-12-19 17:34

    You might want try changing your line @PrepareForTest statement.

    From:

    @PrepareForTest(KeyPairGenerator.class)
    

    to:

    @PrepareForTest(ClassThatCallsTheStaticMethod.class)
    
    0 讨论(0)
提交回复
热议问题