then seems to end up with two versions of the findById method:
public java.lang.Object uk.co.greenthistle.coroutinespybeanexample.ExampleRepository$MockitoMock$poIc1iZ2.findById(java.lang.Object,kotlin.coroutines.Continuation)
and also
public java.lang.Object uk.co.greenthistle.coroutinespybeanexample.ExampleRepository$MockitoMock$poIc1iZ2.findById(java.lang.Long,kotlin.coroutines.Continuation)
This seems to then cause the new spring boot code to choose the wrong method and then not be able to find the correct method to call on the spy.
Originally raised as Upgrade to Spring Framework 6.1 causes null pointer in CoroutinesUtils, but investigated by Spring there and considered to be a bug here instead.
I've got a reactive kotlin spring boot repository that I'm attempting to spy. The superclass (
CoroutineCrudRepository
) has methods such as:When autowiring the repository interface using Spring this gets created with a proxy signature of
Creating a spy from the repository using
then seems to end up with two versions of the
findById
method:and also
This seems to then cause the new spring boot code to choose the wrong method and then not be able to find the correct method to call on the spy.
Please see example project demonstrating the issue at https://github.com/petergphillips/spring-coroutine-spybean-example