Code example for ProxyFactory

Methods: getProxy, setTargetClass

0
     * 
     * @return 
     * @throws NoSuchMethodException 
     */ 
    public static MockMethodInvocation createSec2150MethodInvocation() throws NoSuchMethodException {
        ProxyFactory factory = new ProxyFactory(new Class[] {PersonRepository.class});
        factory.setTargetClass(CrudRepository.class);
        PersonRepository repository = (PersonRepository) factory.getProxy();
        return new MockMethodInvocation(repository, PersonRepository.class , "findAll");
    } 
}