|
1 | 1 | /*
|
2 |
| - * Copyright 2015 the original author or authors. |
| 2 | + * Copyright 2015-2016 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
25 | 25 | import org.springframework.aop.framework.Advised;
|
26 | 26 | import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
27 | 27 | import org.springframework.data.repository.CrudRepository;
|
| 28 | +import org.springframework.test.util.ReflectionTestUtils; |
28 | 29 | import org.springframework.transaction.interceptor.TransactionInterceptor;
|
29 | 30 |
|
30 | 31 | /**
|
@@ -67,9 +68,22 @@ public void disablesDefaultTransactionsIfConfigured() {
|
67 | 68 | assertThat(found, is(true));
|
68 | 69 | }
|
69 | 70 |
|
| 71 | + /** |
| 72 | + * @see DATACMNS-880 |
| 73 | + */ |
| 74 | + @Test |
| 75 | + public void propagatesBeanFactoryToSuperClass() { |
| 76 | + |
| 77 | + SampleTransactionalRepositoryFactoryBean factoryBean = new SampleTransactionalRepositoryFactoryBean(); |
| 78 | + factoryBean.setBeanFactory(new DefaultListableBeanFactory()); |
| 79 | + |
| 80 | + assertThat(ReflectionTestUtils.getField(factoryBean, RepositoryFactoryBeanSupport.class, "beanFactory"), |
| 81 | + is(notNullValue())); |
| 82 | + } |
| 83 | + |
70 | 84 | @SuppressWarnings({ "unchecked", "rawtypes" })
|
71 |
| - static class SampleTransactionalRepositoryFactoryBean extends |
72 |
| - TransactionalRepositoryFactoryBeanSupport<CrudRepository<Object, Long>, Object, Long> { |
| 85 | + static class SampleTransactionalRepositoryFactoryBean |
| 86 | + extends TransactionalRepositoryFactoryBeanSupport<CrudRepository<Object, Long>, Object, Long> { |
73 | 87 |
|
74 | 88 | private final CrudRepository<Object, Long> repository = mock(CrudRepository.class);
|
75 | 89 |
|
|
0 commit comments