DATAREST-684 - ProxyProjectionFactory now exposes target instance on proxy.

Changed TargetClassAware to TargetAware and expose the actual proxy target for framework purposes.
This commit is contained in:
Oliver Gierke
2015-04-15 20:42:34 +02:00
parent 9977c61667
commit cb78260322
3 changed files with 72 additions and 24 deletions

View File

@@ -176,6 +176,18 @@ public class ProxyProjectionFactoryUnitTests {
assertThat(advisors[0].getAdvice(), is(instanceOf(DefaultMethodInvokingMethodInterceptor.class)));
}
/**
* @see DATACMNS-648
*/
@Test
public void exposesProxyTarget() {
CustomerExcerpt excerpt = factory.createProjection(CustomerExcerpt.class);
assertThat(excerpt, is(instanceOf(TargetAware.class)));
assertThat(((TargetAware) excerpt).getTarget(), is(instanceOf(Map.class)));
}
static class Customer {
public String firstname, lastname;