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)

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web1

  • via GitHub by folone
    ,
  • Stack trace

    • 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(ZkClientSpec.scala:145) at com.twitter.zk.ZkClientSpec$$anonfun$2$$anonfun$apply$mcV$sp$52$$anonfun$apply$mcV$sp$56.apply$mcV$sp(ZkClientSpec.scala:557) at com.twitter.zk.ZkClientSpec$$anonfun$2$$anonfun$apply$mcV$sp$52$$anonfun$apply$mcV$sp$56.apply(ZkClientSpec.scala:554) at com.twitter.zk.ZkClientSpec$$anonfun$2$$anonfun$apply$mcV$sp$52$$anonfun$apply$mcV$sp$56.apply(ZkClientSpec.scala:554) at org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22) at org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22) at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85) at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104) at org.scalatest.Transformer.apply(Transformer.scala:22) at org.scalatest.Transformer.apply(Transformer.scala:20)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    We couldn't find other users who have seen this exception.