https://kotlinlang.org logo
#spek
Title
j

jackmiras

05/17/2017, 7:06 PM
@jk Nothing change
j

jk

05/18/2017, 8:49 AM
🙁 it’ll be good to try to figure out why it doesn’t do the same thing when you run the same tests in IntelliJ
because then you’ll be able to use the debugger
j

jackmiras

05/19/2017, 1:22 PM
@jk I found where exactly my tests are breaking, but I'm still unable to fix the problem... The exeception:
Copy code
Failures (1):
  Spek:user.UserPresenterTest:given the user presenter:given a post action with a already registered user
    => org.mockito.exceptions.misusing.UnfinishedVerificationException:
Missing method call for verify(mock) here:
-> at user.UserPresenterTest$1$1$3$1.invoke(UserPresenterTest.kt:73)

Example of correct verification:
    verify(mock).doSomething()

Also, this error might show up because you verify either of: final/private/equals()/hashCode() methods.
Those methods *cannot* be stubbed/verified.
Mocking methods declared on non-public parent classes is not supported.
Happen when JUnit try to execute an expression like this one
whenever(request.body()).thenReturn(user.toJson())
where the
request
object is an mock.
Do you have any clue of what may be happening?
j

jk

05/19/2017, 1:23 PM
does it happen when you run the test in intellij too?
j

jackmiras

05/19/2017, 1:23 PM
No
j

jk

05/19/2017, 1:24 PM
what’s at
UserPresenterTest.kt:73
?
j

jackmiras

05/19/2017, 1:27 PM
whenever(request.body()).thenReturn(user.toJson())
j

jk

05/19/2017, 1:56 PM
sorry it’s quite difficult to debug without the code
r

raniejade

05/21/2017, 12:25 PM
@jackmiras is it possible to upload a sample project that reproduces this? The build script might also help shed some light.
2 Views