Using PowerMock with Spock

前端 未结 3 1372
有刺的猬
有刺的猬 2021-02-04 13:00

I have a class with a few static methods.I need to Mock these static methods. I know PowerMock does this,but I was not able to find any tutorials/materials that shed some light

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-04 13:46

    There is no special integration; your best bet is to try and use PowerMock "as-is". From what I remember, PowerMock used to have problems with Groovy, and I don't know if this has been solved. And if I'm not mistaken, PowerMock rewrites the byte code of test classes, so the next question is if it works with Spock. Let us know what you find.

提交回复
热议问题