

Val result=service.withArguments().collectList().block()īasically when i run the test with StepVerifier, then i end up in infinite loop (i cancelled the tests after 10 minutes) but in case when i comment out the step verifier, than i am getting following error:Ĭannot invoke ".collectList()" because the return value of ".ParentService. If the method being matched is written in Java then I think that it will work as all Java objects are implicitly nullable. This is because it can return void and this is not assignable to a non-nullable parameter. Return Flux.just(1, 2, 3, 4).publishOn(omExecutor(pool))įun methodWithArgument(list: List): Flux If you have a method written in kotlin that does not take a nullable parameter then we cannot match with it using Mockito.any (). You need to use verify belonging to framework you used to construct the mock.

SpringSource Org Mockito 13 usages org. kotlin junit mockito mockk-verify Share Improve this question Follow asked yesterday ever alian 1,026 3 13 45 Add a comment 1 Answer Sorted by: 0 You are using 2 mocking frameworks in one test.

Mockito Android 20 usages org.mockito mockito-android MIT Mockito for Android Last Release on 10. here is my simplified code: ServiceToBeMocked lateinit var pool: WorkerPool Mockito Kotlin 78 usages Group Mockito Kotlin 9. I haven't worked with Mockito at all, and with spring i am just starting (have experience with Micronaut).
