org.mockito.exceptions.misusing.UnfinishedStubbingException: Unfinished stubbing detected here: -> at org.powermock.api.mockito.internal.PowerMockitoCore. doAnswer(PowerMockitoCore.java:36) E.g. thenReturn() may be missing. Examples of correct stubbing: when(mock.isOk()).thenReturn(true); when(mock.isOk()).thenThrow(exception); doThrow(exception).when(mock).someVoidMethod(); Hints: 1. missing thenReturn() 2. you are trying to stub a final method, you naughty developer! at org.powermock.api.mockito.internal.invocation. MockitoMethodInvocationControl.performIntercept( MockitoMethodInvocationControl.java:260) at org.powermock.api.mockito.internal.invocation. MockitoMethodInvocationControl.invoke(MockitoMethodInvocationControl .java:192)

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Google Groups by mike, 10 months ago
(mock.isOk()).thenThrow(exception); doThrow(exception).when(mock).someVoidMethod(); Hints: 1. missing thenReturn() 2. you are trying to stub a final method, you naughty developer! at org.powermock.api.mockito.internal.invocation
org.mockito.exceptions.misusing.UnfinishedStubbingException: Unfinished stubbing detected here: -> at org.powermock.api.mockito.internal.PowerMockitoCore. doAnswer(PowerMockitoCore.java:36) E.g. thenReturn() may be missing. Examples of correct stubbing: when(mock.isOk()).thenReturn(true); when(mock.isOk()).thenThrow(exception); doThrow(exception).when(mock).someVoidMethod(); Hints: 1. missing thenReturn() 2. you are trying to stub a final method, you naughty developer! at org.powermock.api.mockito.internal.invocation. MockitoMethodInvocationControl.performIntercept( MockitoMethodInvocationControl.java:260) at org.powermock.api.mockito.internal.invocation. MockitoMethodInvocationControl.invoke(MockitoMethodInvocationControl .java:192)
at org.powermock.core.MockGateway.doMethodCall(MockGateway.java:123)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.