These are chat archives for etorreborre/specs2

6th
Oct 2017
hodga
@hodga
Oct 06 2017 12:59
Hi, I updated to specs2 4.0.0 running scala 2.12.3, and I get org.mockito.exceptions.misusing.UnfinishedVerificationException. THis only occurs when i run with “sbt test”, and not when i run all tests in intellij and also not when i run individual tests. And the tests that the error occur in changes if i remove the tests that gets the error.
[error] ! attempt to send a transaction to the new revenueSystem [error] org.mockito.exceptions.misusing.UnfinishedVerificationException: [error] Missing method call for verify(mock) here: [error] -> at org.specs2.mock.MockitoMocker.verify(MockitoMocker.scala:35) [error] [error] Example of correct verification: [error] verify(mock).doSomething() [error] [error] Also, this error might show up because you verify either of: final/private/equals()/hashCode() methods. [error] Those methods *cannot* be stubbed/verified. [error] Mocking methods declared on non-public parent classes is not supported. (RevenueSystemProducerTest.scala:28)
I am sure that final/private/equals() does not apply since it works when run individually
Eric Torreborre
@etorreborre
Oct 06 2017 14:35
@hodga can you check the mockito version you are using? For specs2 4.0.0 it should be 2.7.22
then also sbt clean
hodga
@hodga
Oct 06 2017 16:32
I am using mockito 2.7.22, and i did sbt clean plus the error occured first on our build server which starts with a clean repo. I also forgot to mention i changed from using the trait executionenvironment to OwnExecutionEnv. Thanks for helping:)
Eric Torreborre
@etorreborre
Oct 06 2017 18:41
Weird, would you have a trimmed down project where I could reproduce the issue?
hodga
@hodga
Oct 06 2017 19:09
I can try to reproduce it in a separate project, but that have to wait until Monday. Until then: I think it has something to do with "there was after(time).one(mock).fuction" since that is the only mock verification i do in the test that gets the error and the one before.
Also using a implicit execution context
Eric Torreborre
@etorreborre
Oct 06 2017 22:58
One thing you can try for debugging is to call bare Mockito in your test without the specs2 sugar maybe there's a bug in there