Search in sources :

Example 81 with ProxyFactory

use of org.springframework.aop.framework.ProxyFactory in project spring-data-mongodb by spring-projects.

the class MappingMongoConverterUnitTests method shouldWriteCglibProxiedClassTypeInformationCorrectly.

// DATAMONGO-1001, DATAMONGO-1509
@Test
public void shouldWriteCglibProxiedClassTypeInformationCorrectly() {
    ProxyFactory factory = new ProxyFactory();
    factory.setTargetClass(GenericType.class);
    factory.setProxyTargetClass(true);
    GenericType<?> proxied = (GenericType<?>) factory.getProxy();
    org.bson.Document document = new org.bson.Document();
    converter.write(proxied, document);
    assertTypeHint(document, GenericType.class);
}
Also used : ProxyFactory(org.springframework.aop.framework.ProxyFactory) Document(org.springframework.data.mongodb.core.mapping.Document) Test(org.junit.Test)

Aggregations

ProxyFactory (org.springframework.aop.framework.ProxyFactory)81 Test (org.junit.Test)49 ITestBean (org.springframework.tests.sample.beans.ITestBean)20 TestBean (org.springframework.tests.sample.beans.TestBean)20 TimeStamped (org.springframework.tests.TimeStamped)8 INestedTestBean (org.springframework.tests.sample.beans.INestedTestBean)8 NestedTestBean (org.springframework.tests.sample.beans.NestedTestBean)8 Method (java.lang.reflect.Method)6 HashMap (java.util.HashMap)5 MethodBeforeAdvice (org.springframework.aop.MethodBeforeAdvice)4 Context (javax.naming.Context)3 TargetSource (org.springframework.aop.TargetSource)3 Advised (org.springframework.aop.framework.Advised)3 DefaultPointcutAdvisor (org.springframework.aop.support.DefaultPointcutAdvisor)3 Factory (org.springframework.cglib.proxy.Factory)3 NopInterceptor (org.springframework.tests.aop.interceptor.NopInterceptor)3 IOException (java.io.IOException)2 EJBLocalObject (javax.ejb.EJBLocalObject)2 Message (javax.jms.Message)2 TextMessage (javax.jms.TextMessage)2