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)

Google Groups | mike | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Replacement for extends PowerMockTestCase i TestNG

    Google Groups | 2 years ago | mike
    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)

    Root Cause Analysis

    1. 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()
    2. powermock-core
      MockGateway.methodCall
      1. org.powermock.core.MockGateway.doMethodCall(MockGateway.java:123)
      2. org.powermock.core.MockGateway.methodCall(MockGateway.java:62)
      2 frames