Mockito and PowerMock MethodNotFoundException being thrown

前端 未结 2 1365
隐瞒了意图╮
隐瞒了意图╮ 2021-01-14 04:19

Running into the below error when using Powermockito and Mockito to build some simple unit tests for a connection pool I made that wraps around Hikari CP. The setup of the

相关标签:
2条回答
  • 2021-01-14 04:57

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

    0 讨论(0)
  • 2021-01-14 04:58

    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.

    0 讨论(0)
提交回复
热议问题