org.mockito.exceptions.misusing.UnfinishedStubbingException: Unfinished stubbing detected here: -> at com.twitter.zk.ZkClientSpec.watchChildren(ZkClientSpec.scala:117) 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. although stubbed methods may return mocks, you cannot inline mock creation (mock()) call inside a thenReturn method (see issue 53)

GitHub | folone | 3 years ago
  1. 0

    GitHub comment 95#41253955

    GitHub | 3 years ago | folone
    org.mockito.exceptions.misusing.UnfinishedStubbingException: Unfinished stubbing detected here: -> at com.twitter.zk.ZkClientSpec.watchChildren(ZkClientSpec.scala:117) 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. although stubbed methods may return mocks, you cannot inline mock creation (mock()) call inside a thenReturn method (see issue 53)
  2. 0

    Mockito/PowerMockito: Weird Stubbing Exception

    Stack Overflow | 1 year ago | Sidney de Moraes
    org.mockito.exceptions.misusing.UnfinishedStubbingException: Unfinished stubbing detected here: -> at org.powermock.api.mockito.internal.PowerMockitoCore.doAnswer(PowerMockitoCore.java:31) 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. although stubbed methods may return mocks, you cannot inline mock creation (mock()) call inside a thenReturn method (see issue 53)
  3. 0

    Mock Jersey Client Request response using Mockito and Junit

    Stack Overflow | 3 years ago | kunal
    org.mockito.exceptions.misusing.UnfinishedStubbingException: Unfinished stubbing detected here: -> at .......service.workflow.client.RestClientUnitTest.setUp(RestClientUnitTest.java:35) 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. although stubbed methods may return mocks, you cannot inline mock creation (mock()) call inside a thenReturn method (see issue 53) at ......service.workflow.client.RestClientUnitTest.setUp(RestClientUnitTest.java:37)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Mockito test case failing

    Stack Overflow | 1 week ago | Aleksey Timoshchenko
    org.mockito.exceptions.misusing.UnfinishedStubbingException: Unfinished stubbing detected here: -> at com.fittingroom.newtimezone.presenters.PresenterActivityAcceptNotAcceptTes t.setOriginPreviewImage(PresenterActivityAcceptNotAcceptTest.java:30) 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! 3: you are stubbing the behaviour of another mock inside before 'thenReturn' instruction if completed
  6. 0

    Powermock: Static interface method gives unfinished stubbing exception

    Stack Overflow | 1 year ago | juxeii
    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! 3: you are stubbing the behaviour of another mock inside before 'thenReturn' instruction if completed

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.mockito.exceptions.misusing.UnfinishedStubbingException

      Unfinished stubbing detected here: -> at com.twitter.zk.ZkClientSpec.watchChildren(ZkClientSpec.scala:117) 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. although stubbed methods may return mocks, you cannot inline mock creation (mock()) call inside a thenReturn method (see issue 53)

      at com.twitter.zk.ZkClientSpec.watchData()
    2. util-zk-common
      ZkClientSpec$$anonfun$2$$anonfun$apply$mcV$sp$52$$anonfun$apply$mcV$sp$56.apply
      1. com.twitter.zk.ZkClientSpec.watchData(ZkClientSpec.scala:145)
      2. com.twitter.zk.ZkClientSpec$$anonfun$2$$anonfun$apply$mcV$sp$52$$anonfun$apply$mcV$sp$56.apply$mcV$sp(ZkClientSpec.scala:557)
      3. com.twitter.zk.ZkClientSpec$$anonfun$2$$anonfun$apply$mcV$sp$52$$anonfun$apply$mcV$sp$56.apply(ZkClientSpec.scala:554)
      4. com.twitter.zk.ZkClientSpec$$anonfun$2$$anonfun$apply$mcV$sp$52$$anonfun$apply$mcV$sp$56.apply(ZkClientSpec.scala:554)
      4 frames
    3. scalatest
      Transformer.apply
      1. org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22)
      2. org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22)
      3. org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
      4. org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
      5. org.scalatest.Transformer.apply(Transformer.scala:22)
      6. org.scalatest.Transformer.apply(Transformer.scala:20)
      6 frames