Adds failing unit-test for StringBasedAggregation projections.
See #4839 Original pull request: #4841
This commit is contained in:
committed by
Mark Paluch
parent
28d4672b3f
commit
e882594f89
@@ -1275,6 +1275,11 @@ public abstract class AbstractPersonRepositoryIntegrationTests implements Dirtie
|
||||
assertThat(repository.findClosedProjectionBy()).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test // https://github.com/spring-projects/spring-data-mongodb/issues/4839
|
||||
void findAggregatedClosedProjectionBy() {
|
||||
assertThat(repository.findAggregatedClosedProjectionBy()).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1865
|
||||
void findFirstEntityReturnsFirstResultEvenForNonUniqueMatches() {
|
||||
assertThat(repository.findFirstBy()).isNotNull();
|
||||
|
||||
@@ -386,6 +386,10 @@ public interface PersonRepository extends MongoRepository<Person, String>, Query
|
||||
// DATAMONGO-1752
|
||||
Iterable<PersonSummary> findClosedProjectionBy();
|
||||
|
||||
// https://github.com/spring-projects/spring-data-mongodb/issues/4839
|
||||
@Aggregation("{ '$project': { _id : 0, firstName : 1, lastname : 1 } }")
|
||||
Iterable<PersonSummary> findAggregatedClosedProjectionBy();
|
||||
|
||||
@Query(sort = "{ age : -1 }")
|
||||
List<Person> findByAgeGreaterThan(int age);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user