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
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

    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)

    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