Mockito and PowerMock MethodNotFoundException being thrown

淺唱寂寞╮ 提交于 2019-12-02 01:16:59

Going to post an answer just in case someone else sees this. Reverting all versions to 1.6.5 solved the problem.

user2237511

I don't have enough reputation to comment, so unfortunately I am using the answer space to comment.

Markll, I am running into similar issues, here's my SO question - org.powermock.reflect.exceptions.MethodNotFoundException: - when mocking java sql classes Does Mockito.when(mockConnection.createStatement()).thenReturn(mockStatement); work for you? Mine doesn't even get past that. May be you can help me with that. My latest conclusion is since Connection, Statement and ResultSets are actually interfaces not classes, that's the reason it's throwing the error saying it can't find in the hierarchy of Object.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!