Package org.springframework.data.repository.core.support.TransactionalRepositoryProxyPostProcessor

Examples of org.springframework.data.repository.core.support.TransactionalRepositoryProxyPostProcessor.CustomAnnotationTransactionAttributeSource


public class CustomAnnotationTransactionAttributeSourceUnitTests {

  @Test
  public void usesCustomTransactionConfigurationOnInterface() throws SecurityException, NoSuchMethodException {

    CustomAnnotationTransactionAttributeSource source = new TransactionalRepositoryProxyPostProcessor.CustomAnnotationTransactionAttributeSource();

    TransactionAttribute attribute = source.getTransactionAttribute(Bar.class.getMethod("bar", Object.class),
        FooImpl.class);
    assertThat(attribute.isReadOnly(), is(false));

    attribute = source.getTransactionAttribute(Bar.class.getMethod("foo"), FooImpl.class);
    assertThat(attribute.isReadOnly(), is(false));
  }
View Full Code Here


    Method repositorySaveMethod = SampleRepository.class.getMethod("save", Sample.class);
    Method implementationClassMethod = implementationClass.getMethod("save", Object.class);

    when(repositoryInformation.getTargetClassMethod(repositorySaveMethod)).thenReturn(implementationClassMethod);

    CustomAnnotationTransactionAttributeSource attributeSource = new CustomAnnotationTransactionAttributeSource();
    attributeSource.setRepositoryInformation(repositoryInformation);

    TransactionAttribute attribute = attributeSource.getTransactionAttribute(repositorySaveMethod,
        SampleImplementation.class);

    assertThat(attribute, Matchers.is(Matchers.notNullValue()));
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.repository.core.support.TransactionalRepositoryProxyPostProcessor.CustomAnnotationTransactionAttributeSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.