Skip to content

Commit ed2dda5

Browse files
authored
Add Scala test methods to SyncMongoCollection. (#1167)
1 parent 40e2d1f commit ed2dda5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoCollection.scala

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,34 @@ case class SyncMongoCollection[T](wrapped: MongoCollection[T]) extends JMongoCol
480480
override def drop(clientSession: ClientSession, dropCollectionOptions: DropCollectionOptions): Unit =
481481
wrapped.drop(unwrap(clientSession), dropCollectionOptions).toFuture().get()
482482

483+
override def createSearchIndex(indexName: String, definition: Bson) =
484+
wrapped.createSearchIndex(indexName, definition).toFuture().get()
485+
486+
override def createSearchIndex(definition: Bson) =
487+
wrapped.createSearchIndex(definition).toFuture().get()
488+
489+
override def createSearchIndexes(searchIndexModels: java.util.List[SearchIndexModel]) =
490+
wrapped.createSearchIndexes(searchIndexModels.asScala.toList).toFuture().get().asJava
491+
492+
def updateSearchIndex(indexName: String, definition: Bson) =
493+
wrapped.updateSearchIndex(indexName, definition).toFuture().get()
494+
495+
def dropSearchIndex(indexName: String) = wrapped.dropSearchIndex(indexName).toFuture().get()
496+
497+
override def listSearchIndexes() = SyncListSearchIndexesIterable(
498+
wrapped
499+
.listSearchIndexes()
500+
)
501+
502+
override def listSearchIndexes[TResult](resultClass: Class[TResult]) =
503+
SyncListSearchIndexesIterable[TResult](
504+
wrapped
505+
.listSearchIndexes[TResult]()(
506+
DefaultsTo.overrideDefault[TResult, org.mongodb.scala.Document],
507+
ClassTag(resultClass)
508+
)
509+
)
510+
483511
override def createIndex(keys: Bson): String = wrapped.createIndex(keys).toFuture().get()
484512

485513
override def createIndex(keys: Bson, indexOptions: IndexOptions) =

0 commit comments

Comments
 (0)