Stefano Cordio
Stefano Cordio
I'll give it a try and get back to you
The following can help bring out the underlying type: ```java @Test public void test() { PersonRepo.Person alice = personRepo.getPerson(); PersonRepo.Person bob = new PersonImpl("bob"); assertThat(alice) .asInstanceOf(type(org.springframework.data.projection.TargetAware.class)) .extracting(org.springframework.data.projection.TargetAware::getTarget) .usingRecursiveComparison() .isEqualTo(bob); }...
@joel-costigliola I'm thinking about having some proxy-specific handling. My rough idea is that, for the current example: * `alice instanceof java.lang.reflect.Proxy` returns `true` --> decision point for special handling *...
I couldn't find any straightforward way to identify the "good" interface that the proxy implements so I made it work with a custom introspection strategy that identifies the properties to...
Although the trigger was Spring, the issue applies generically to any code using `java.lang.reflect.Proxy`, whether it's a framework, library, or user code. For example, I don't have concrete experience with...
By the way, we should check how this approach behaves with a more complex object graph, e.g., when the given types also appear in nested fields. It may be nothing...
I still wonder how to improve the user experience for the original example... We could throw some misconfiguration exception in case the object under test is a proxy (detected via...
@jay-babu have you checked if the workaround at https://github.com/assertj/assertj/issues/3551#issuecomment-2259822099 fits your use case?
Thanks for reporting the issue and providing a compact reproducer, @DidierLoiseau!
As Joel said, we're not that happy about making any breaking changes in version 3, but version 4 might be the right time to rethink how to better support Kotlin.