< Back
 

# Packages

-  package root
  Definition Classes
    root
-  package uk
  Definition Classes
    root
-  package gov
  Definition Classes
    uk
-  package hmrc
  Definition Classes
    gov
-  package mongo
  Definition Classes
    hmrc
-  package test
  Definition Classes
    mongo
- CleanMongoCollectionSupport
- DefaultPlayMongoRepositorySupport
- IndexedMongoQueriesSupport
- MongoSupport
- PlayMongoRepositorySupport

p

uk.gov.hmrc.mongo

# test 

#### 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

   Provides all the typical mongo testing support.

   Provides all the typical mongo testing support.

   See PlayMongoRepositorySupport for setting up.

   In addition it will ensure the database is cleaned, and setup (with indexes and schemas) before each test.

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.

   optSchema }}}

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

   repository }}}

   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.

   optSchema }}}

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

### Ungrouped