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 | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Replacement for extends PowerMockTestCase i TestNG

    Google Groups | 3 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