Using ReflectionTestUtils with Spring AOP to set a field
When using spring”s handy ReflectionTestUtils to set a field on an AOP proxied object, it has trouble setting fields on the proxy object (complaining that “field not found”). In this case you need to unwrap the original object from the proxy. private Object unwrapProxy(Class clazz, Object proxy) { if(AopUtils.isAopProxy(proxy) &&...