Example usage for org.springframework.beans.factory.config MethodInvokingFactoryBean getTargetObject

List of usage examples for org.springframework.beans.factory.config MethodInvokingFactoryBean getTargetObject

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config MethodInvokingFactoryBean getTargetObject.

Prototype

@Nullable
public Object getTargetObject() 

Source Link

Document

Return the target object on which to call the target method.

Usage

From source file:org.springframework.aop.aspectj.autoproxy.AspectJAutoProxyCreatorTests.java

@Test
public void testAspectsAreApplied() {
    ClassPathXmlApplicationContext bf = newContext("aspects.xml");
    ITestBean tb = (ITestBean) bf.getBean("adrian");
    assertEquals(68, tb.getAge());/*from   w  w  w  .  j a  v a 2s .c  o  m*/
    MethodInvokingFactoryBean factoryBean = (MethodInvokingFactoryBean) bf.getBean("&factoryBean");
    assertTrue(AopUtils.isAopProxy(factoryBean.getTargetObject()));
    assertEquals(68, ((ITestBean) factoryBean.getTargetObject()).getAge());
}