@ -39,6 +39,8 @@ class ReactiveMongoQueryMethodCoroutineUnitTests {
@@ -39,6 +39,8 @@ class ReactiveMongoQueryMethodCoroutineUnitTests {
suspend fun findSuspendAllByName ( ) : Flow < Person >
fun findAllByName ( ) : Flow < Person >
suspend fun findSuspendByName ( ) : List < Person >
}
@Test // DATAMONGO-2562
@ -58,4 +60,13 @@ class ReactiveMongoQueryMethodCoroutineUnitTests {
@@ -58,4 +60,13 @@ class ReactiveMongoQueryMethodCoroutineUnitTests {
assertThat ( queryMethod . isCollectionQuery ) . isTrue ( )
}
@Test // DATAMONGO-2630
internal fun `should consider suspended methods returning List as collection queries` ( ) {
val method = PersonRepository :: class . java . getMethod ( " findSuspendByName " , Continuation :: class . java )
val queryMethod = ReactiveMongoQueryMethod ( method , DefaultRepositoryMetadata ( PersonRepository :: class . java ) , projectionFactory , MongoMappingContext ( ) )
assertThat ( queryMethod . isCollectionQuery ) . isTrue ( )
}
}