@Test public void shouldReturnProxyTarget() { Object bean = new Object(); TestProxy proxy = new TestProxy(bean); Object target = MotechProxyUtils.getTargetIfProxied(proxy); assertThat(target, IsSame.sameInstance(bean)); }
public static Object getTargetIfProxied(Object proxy) { if (isMotechListenerProxy(proxy)) { MotechListenerAbstractProxy listenerProxy = (MotechListenerAbstractProxy) proxy; return listenerProxy.getBean(); } return proxy; }
MotechProxyUtils { public static Object getTargetIfProxied(Object proxy) { if (isMotechListenerProxy(proxy)) { MotechListenerAbstractProxy listenerProxy = (MotechListenerAbstractProxy) proxy; return listenerProxy.getBean(); } return proxy; } }
MotechProxyUtils { public static Object getTargetIfProxied(Object proxy) { if (isMotechListenerProxy(proxy)) { MotechListenerAbstractProxy listenerProxy = (MotechListenerAbstractProxy) proxy; return listenerProxy.getBean(); } return proxy; } private  MotechProxyUtils(); }
MotechProxyUtils { public static Object getTargetIfProxied(Object proxy) { if (isMotechListenerProxy(proxy)) { MotechListenerAbstractProxy listenerProxy = (MotechListenerAbstractProxy) proxy; return listenerProxy.getBean(); } return proxy; } private  MotechProxyUtils(); static boolean isMotechListenerProxy(Object object); static Object getTargetIfProxied(Object proxy); }
MotechProxyUtils { public static Object getTargetIfProxied(Object proxy) { if (isMotechListenerProxy(proxy)) { MotechListenerAbstractProxy listenerProxy = (MotechListenerAbstractProxy) proxy; return listenerProxy.getBean(); } return proxy; } private  MotechProxyUtils(); static boolean isMotechListenerProxy(Object object); static Object getTargetIfProxied(Object proxy);  }