Packages

package test

Type Members

  1. trait CleanMongoCollectionSupport extends MongoSupport with BeforeAndAfterEach

    Calls prepareDatabase before each test, ensuring a clean database

  2. trait DefaultPlayMongoRepositorySupport[A] extends PlayMongoRepositorySupport[A] with CleanMongoCollectionSupport with IndexedMongoQueriesSupport with TtlIndexedMongoSupport

    Provides all the typical mongo testing support.

    Provides all the typical mongo testing support.

    See PlayMongoRepositorySupport for setting up.

    It will also:

    • ensure the database is cleaned, and setup (with indexes and schemas) before each test
    • ensure all queries have indices
    • check that repositories have a ttl index, pointing at a Date field
  3. trait IndexedMongoQueriesSupport extends MongoSupport with BeforeAndAfterAll

    Causes queries which don't use an index to generate com.mongodb.MongoQueryException or com.mongodb.MongoWriteException containing error code 291 (for mongo 4.4+ and error code 2 with message 'No query solutions' previously).

    Causes queries which don't use an index to generate com.mongodb.MongoQueryException or com.mongodb.MongoWriteException containing error code 291 (for mongo 4.4+ and error code 2 with message 'No query solutions' previously).

    Note, the notablescan option is a global server config. When running database tests with and without this trait, ensure that tests are not run in parallel.

  4. trait MongoSupport extends ScalaFutures
  5. trait PlayMongoRepositorySupport[A] extends MongoSupport

    Specialises MongoSupport for PlayMongoRepository.

    Specialises MongoSupport for PlayMongoRepository.

    It is recommended to use DefaultPlayMongoRepositorySupport which brings this together with other useful testing support.

    repository

    will need overriding with the repository under test.

    If a schema is not defined on the repository, it can still be provided for tests by overridding

    optSchema

    .

    CRUD methods are provided which can help preparing and asserting repository behaviour.

  6. trait TtlIndexedMongoSupport extends MongoSupport with TestSuite

Ungrouped