|
33 | 33 | import org.springframework.context.ApplicationListener;
|
34 | 34 | import org.springframework.context.event.EventListener;
|
35 | 35 | import org.springframework.data.repository.CrudRepository;
|
| 36 | +import org.springframework.data.repository.reactive.ReactiveCrudRepository; |
36 | 37 | import org.springframework.modulith.core.ArchitecturallyEvidentType.SpringAwareArchitecturallyEvidentType;
|
37 | 38 | import org.springframework.modulith.core.ArchitecturallyEvidentType.SpringDataAwareArchitecturallyEvidentType;
|
38 | 39 | import org.springframework.stereotype.Repository;
|
@@ -76,6 +77,24 @@ void detectsSpringAnnotatedRepositories() {
|
76 | 77 | assertThat(type.isRepository()).isTrue();
|
77 | 78 | }
|
78 | 79 |
|
| 80 | + @Test // GH-187 |
| 81 | + void detectsSpringDataRepositories() { |
| 82 | + |
| 83 | + var type = ArchitecturallyEvidentType.of( |
| 84 | + classes.getRequiredClass(SampleRepository.class), Classes.NONE); |
| 85 | + |
| 86 | + assertThat(type.isRepository()).isTrue(); |
| 87 | + } |
| 88 | + |
| 89 | + @Test // GH-187 |
| 90 | + void detectsReactiveSpringDataRepositories() { |
| 91 | + |
| 92 | + var type = ArchitecturallyEvidentType.of( |
| 93 | + classes.getRequiredClass(ReactiveSampleRepository.class), Classes.NONE); |
| 94 | + |
| 95 | + assertThat(type.isRepository()).isTrue(); |
| 96 | + } |
| 97 | + |
79 | 98 | @Test
|
80 | 99 | void doesNotConsiderEntityAggregateRoot() {
|
81 | 100 |
|
@@ -197,6 +216,9 @@ class SampleEntity {}
|
197 | 216 |
|
198 | 217 | interface SampleRepository extends CrudRepository<SampleEntity, UUID> {}
|
199 | 218 |
|
| 219 | + // GH-187 |
| 220 | + interface ReactiveSampleRepository extends ReactiveCrudRepository<SampleEntity, UUID> {} |
| 221 | + |
200 | 222 | @Entity
|
201 | 223 | class OtherEntity {}
|
202 | 224 |
|
|
0 commit comments