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()));
}