Polishing.
Replace boolean flag with enum, assert open vs. closed projection and update javadoc. Original Pull Request: #2420
This commit is contained in:
@@ -34,6 +34,7 @@ import org.springframework.data.projection.SpelAwareProxyProjectionFactory;
|
||||
* Unit tests for {@link EntityProjectionIntrospector}.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
class EntityProjectionIntrospectorUnitTests {
|
||||
|
||||
@@ -62,6 +63,7 @@ class EntityProjectionIntrospectorUnitTests {
|
||||
EntityProjection<?, ?> descriptor = discoverer.introspect(DomainClassProjection.class, DomainClass.class);
|
||||
|
||||
assertThat(descriptor.isProjection()).isTrue();
|
||||
assertThat(descriptor.isClosedProjection()).isTrue();
|
||||
|
||||
List<PropertyPath> paths = new ArrayList<>();
|
||||
descriptor.forEachRecursive(it -> paths.add(it.getPropertyPath()));
|
||||
@@ -75,6 +77,7 @@ class EntityProjectionIntrospectorUnitTests {
|
||||
EntityProjection<?, ?> descriptor = discoverer.introspect(DomainClassDto.class, DomainClass.class);
|
||||
|
||||
assertThat(descriptor.isProjection()).isTrue();
|
||||
assertThat(descriptor.isClosedProjection()).isTrue();
|
||||
|
||||
List<PropertyPath> paths = new ArrayList<>();
|
||||
descriptor.forEachRecursive(it -> paths.add(it.getPropertyPath()));
|
||||
@@ -103,6 +106,7 @@ class EntityProjectionIntrospectorUnitTests {
|
||||
EntityProjection<?, ?> descriptor = discoverer.introspect(OpenProjection.class, DomainClass.class);
|
||||
|
||||
assertThat(descriptor.isProjection()).isTrue();
|
||||
assertThat(descriptor.isClosedProjection()).isFalse();
|
||||
|
||||
List<PropertyPath> paths = new ArrayList<>();
|
||||
descriptor.forEachRecursive(it -> paths.add(it.getPropertyPath()));
|
||||
|
||||
Reference in New Issue
Block a user