Comments (8)
@gildor please check version 1.7.2 with applied changes and close ticket if everything is OK
from mockk.
Here is exceptions from tests:
io.mockk.MockKTestSuite > MockKTestSuite.verification outcome STANDARD_OUT
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:09 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: call 1 of 1: MockCls(mock).otherOp(eq(1), eq(3))). Only one matching call to MockCls(mock)/otherOp(Int, Int) happened, but arguments are not matching:
[0]: argument: 1, matcher: eq(1), result: +
[1]: argument: 2, matcher: eq(3), result: -
Stack trace:
io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$1.invoke (MockKTestSuite.kt:248)
io.mockk.MockKTestSuite$1$5$1.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:241)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.states.AnsweringState - Answering 3 on MockCls(mock).otherOp(1, 4)
2018-02-06 00:37:09 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: call 1 of 1: MockCls(mock).otherOp(eq(1), eq(3))). No matching calls found.
Calls to same method:
1) MockCls(mock).otherOp(1, 2)
2) MockCls(mock).otherOp(1, 4)
Stack traces:
1) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$2.invoke (MockKTestSuite.kt:256)
io.mockk.MockKTestSuite$1$5$2.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:253)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$2.invoke (MockKTestSuite.kt:257)
io.mockk.MockKTestSuite$1$5$2.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:253)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:09 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: call 1 of 1: MockCls(mock).manyArgsOp(eq(true), eq(false), eq(1), eq(2), eq(3), eq(4), eq(�), eq(�), eq(7), eq(8), eq(9), eq(10), eq(10.0), eq(11.0), eq(12.0), eq(13.0), eq(14), eq(15), eq(IntWrapper(data=16)), eq(IntWrapper(data=17)))) was not called.
Calls to same mock:
1) MockCls(mock).otherOp(1, 2)
Stack traces:
1) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$3.invoke (MockKTestSuite.kt:265)
io.mockk.MockKTestSuite$1$5$3.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:262)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:09 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: call 1 of 1: MockCls(mock).otherOp(eq(1), eq(2))) was not called
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.states.AnsweringState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:09 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: call 1 of 1: MockCls(mock).otherOp(eq(1), eq(2))). 2 matching calls found, but needs at least 3 calls
Calls:
1) MockCls(mock).otherOp(1, 2)
2) MockCls(mock).otherOp(1, 2)
Stack traces:
1) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$5.invoke (MockKTestSuite.kt:277)
io.mockk.MockKTestSuite$1$5$5.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:274)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$5.invoke (MockKTestSuite.kt:278)
io.mockk.MockKTestSuite$1$5$5.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:274)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:09 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: call 1 of 1: MockCls(mock).otherOp(eq(1), eq(2))). One matching call found, but needs at least 3 calls
Call: MockCls(mock).otherOp(1, 2)
Stack trace:
io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$6.invoke (MockKTestSuite.kt:286)
io.mockk.MockKTestSuite$1$5$6.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:283)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:09 [pool-4-thread-1] INFO i.m.i.r.states.AnsweringState - Answering 3 on MockCls(mock).otherOp(1, 3)
2018-02-06 00:37:09 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: calls are not in verification order
Matchers:
MockCls(mock).otherOp(eq(1), eq(3)))
MockCls(mock).otherOp(eq(1), eq(2)))
Calls:
1) MockCls(mock).otherOp(1, 2)
2) MockCls(mock).otherOp(1, 3)
Stack traces:
1) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$7.invoke (MockKTestSuite.kt:293)
io.mockk.MockKTestSuite$1$5$7.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:290)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$7.invoke (MockKTestSuite.kt:294)
io.mockk.MockKTestSuite$1$5$7.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:290)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:10 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 3)
2018-02-06 00:37:10 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: less calls happened then demanded by order verification sequence.
Matchers:
MockCls(mock).otherOp(eq(1), eq(3)))
MockCls(mock).otherOp(eq(1), eq(2)))
Calls:
1) MockCls(mock).otherOp(1, 3)
Stack traces:
1) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$8.invoke (MockKTestSuite.kt:304)
io.mockk.MockKTestSuite$1$5$8.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:301)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:10 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 3)
2018-02-06 00:37:10 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: number of calls happened not matching exact number of verification sequence
Matchers:
MockCls(mock).otherOp(eq(1), eq(3)))
MockCls(mock).otherOp(eq(1), eq(2)))
Calls:
1) MockCls(mock).otherOp(1, 3)
Stack traces:
1) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$9.invoke (MockKTestSuite.kt:314)
io.mockk.MockKTestSuite$1$5$9.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:311)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:10 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:10 [pool-4-thread-1] INFO i.m.i.r.states.AnsweringState - Answering 3 on MockCls(mock).otherOp(1, 3)
2018-02-06 00:37:10 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: calls are not exactly matching verification sequence
Matchers:
MockCls(mock).otherOp(eq(1), eq(3)))
MockCls(mock).otherOp(eq(1), eq(2)))
Calls:
1) MockCls(mock).otherOp(1, 2)
2) MockCls(mock).otherOp(1, 3)
Stack traces:
1) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$10.invoke (MockKTestSuite.kt:324)
io.mockk.MockKTestSuite$1$5$10.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:321)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$10.invoke (MockKTestSuite.kt:325)
io.mockk.MockKTestSuite$1$5$10.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:321)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2018-02-06 00:37:10 [pool-4-thread-1] INFO i.m.i.r.s.AnsweringStillAcceptingAnswersState - Answering 3 on MockCls(mock).otherOp(1, 2)
2018-02-06 00:37:10 [pool-4-thread-1] INFO i.m.i.r.states.AnsweringState - Answering 3 on MockCls(mock).otherOp(1, 3)
2018-02-06 00:37:10 [pool-4-thread-1] INFO io.mockk.MockKTestSuite - Exception: Verification failed: some calls were not matched: [MockCls(mock).otherOp(1, 3)]
Matchers:
MockCls(mock).otherOp(eq(1), eq(2)))
Calls:
1) MockCls(mock).otherOp(1, 2)
2) MockCls(mock).otherOp(1, 3)
Stack traces:
1) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$11.invoke (MockKTestSuite.kt:335)
io.mockk.MockKTestSuite$1$5$11.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:332)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
2) io.mockk.MockCls.otherOp (MockKTestSuite.kt:517)
io.mockk.MockKTestSuite$1$5$11.invoke (MockKTestSuite.kt:336)
io.mockk.MockKTestSuite$1$5$11.invoke (MockKTestSuite.kt:10)
io.mockk.MockKTestSuite$1$4.invoke (MockKTestSuite.kt:230)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:332)
io.mockk.MockKTestSuite$1$5.invoke (MockKTestSuite.kt:10)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:124)
io.kotlintest.Spec$runTest$callable$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke (Spec.kt:15)
io.kotlintest.Spec.interceptTestCase (Spec.kt:78)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:116)
io.kotlintest.Spec$runTest$initialInterceptor$1.invoke (Spec.kt:15)
io.kotlintest.Spec$runTest$callable$1.call (Spec.kt:124)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
from mockk.
Thank you. Can confirm that now I can solve such cases without debugging, stack traces are very informative
The only enhancement that I see to remove mockk internal calls from stacktrace.
For example, this is part of stack trace:
io.mockk.impl.InternalPlatform.captureStackTrace (InternalPlatform.kt:116)
io.mockk.impl.stub.MockKStub.handleInvocation (MockKStub.kt:160)
io.mockk.impl.instantiation.JvmMockFactoryHelper$mockHandler$1.invoke (JvmMockFactoryHelper.kt:17)
io.mockk.impl.instantiation.JvmMockFactoryHelper$mockHandler$1.invoke (JvmMockFactoryHelper.kt:13)
io.mockk.impl.instantiation.JvmMockFactoryKt$sam$MockKInvocationHandler$4dff1f07.invocation (JvmMockFactory.kt:-1)
io.mockk.proxy.MockKProxyInterceptor.intercept (MockKProxyInterceptor.java:20)
com.bandlab.soundbanks.manager.SoundBanksService$ByteBuddy$TzvhGVBh$ByteBuddy$ETvUaZyT.soundbanks (-:-1)
com.bandlab.soundbanks.manager.impl.CachedSoundBanksApi.<init> (CachedSoundBanksApi.kt:21)
com.bandlab.soundbanks.manager.impl.CachedSoundBanksApiTest$cachedApi$2.invoke (CachedSoundBanksApiTest.kt:182)
com.bandlab.soundbanks.manager.impl.CachedSoundBanksApiTest$cachedApi$2.invoke (CachedSoundBanksApiTest.kt:25)
kotlin.SynchronizedLazyImpl.getValue (Lazy.kt:131)
CachedSoundBanksApi.<init>
is correct place, but you also can see methods generated by byte buddy and mockk internals. It would be nice to modify stacktract to remove those methods from stack trace. But not that there is an easy way to detect point where is boundary between client code and library code
Anyway, issue solved. I can log this stacktrace enhancement proposal to a separate issue.
from mockk.
MockKProxyInterceptor.intercept
is good point to cut. As ByteBuddy class is actually subclass of client code i.e. it would show soundbanks
on the top. I actually implemented such stack cut
but for final class mocks. Forgot about this ByteBuddy subclassing.
from mockk.
@oleksiyp Yeah sounds great. ByteBuddy subclass would be nice to cut too, it doesn't have line number information. Should I move this to a separate issue or keep this task open for now?
from mockk.
Just keep it open. I'll release it with some other fixes and close
from mockk.
@gildor check if version 1.7.3 fix your request. if everything ok please close the ticket. thank you
from mockk.
@oleksiyp Yes, this works perfectly. And the even ByteBuddy call is looking nice now.
Thanks for your work!
from mockk.
Related Issues (20)
- kotlinx.datetime.Instant relaxed mock yields null java.time.Instant value
- NoSuchElementException in verify() HOT 3
- Bug: verify on anyConstructed<Mock>() throw an exception
- mockk-1.13.10 breaks tests that mock returning a value class HOT 2
- UInt properties cannot be mocked
- Poor performance with lateinit mockks
- Value class unboxing fails when mocked function and caller have the same name HOT 1
- mockkStatic/mockkObject not working HOT 2
- mockkObject not working in Maven
- Mockk deadlock during parallel tests
- Mocking doesn't work for a functional interface returning a value class
- Any.get() extension function is colliding with other classes extension function
- Can`t mock private property (Missing mocked calls inside every { ... } block: make sure the object inside the block is a mock) HOT 1
- Cannot mock kotlin object's get property that returns value class
- Mocking android.util.Pair throws exception HOT 1
- coVerify verifies wrong method
- Regression - Specifying kotlin.time.Duration as return value for `every` leads to ClassCastException
- Mockk failing when targeting Java 21
- Exception when use 'mockkStatic()' in Java class with mock static function wich has overload
- Cannot mock constructor in instrumented test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mockk.