uk.gov.hmrc.mongo.test
Members list
Type members
Classlikes
Calls prepareDatabase before each test, ensuring a clean database
Calls prepareDatabase before each test, ensuring a clean database
Attributes
- Supertypes
-
trait BeforeAndAfterEachtrait SuiteMixintrait MongoSupporttrait ScalaFuturestrait Futurestrait PatienceConfigurationtrait AbstractPatienceConfigurationtrait ScaledTimeSpansclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait DefaultPlayMongoRepositorySupport[A]
- Self type
-
TestSuite
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
Attributes
- Supertypes
-
trait TtlIndexedMongoSupporttrait TestSuitetrait Suitetrait Serializabletrait Assertionstrait TripleEqualstrait TripleEqualsSupporttrait BeforeAndAfterAlltrait BeforeAndAfterEachtrait SuiteMixintrait PlayMongoRepositorySupport[A]trait MongoSupporttrait ScalaFuturestrait Futurestrait PatienceConfigurationtrait AbstractPatienceConfigurationtrait ScaledTimeSpansclass Objecttrait Matchableclass AnyShow all
- Self type
-
TestSuite
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.
Attributes
- Supertypes
-
trait BeforeAndAfterAlltrait SuiteMixintrait MongoSupporttrait ScalaFuturestrait Futurestrait PatienceConfigurationtrait AbstractPatienceConfigurationtrait ScaledTimeSpansclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait DefaultPlayMongoRepositorySupport[A]
- Self type
-
TestSuite
Attributes
- Supertypes
-
trait ScalaFuturestrait Futurestrait PatienceConfigurationtrait AbstractPatienceConfigurationtrait ScaledTimeSpansclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait DefaultPlayMongoRepositorySupport[A]trait PlayMongoRepositorySupport[A]trait TtlIndexedMongoSupport
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.
Attributes
- Supertypes
-
trait MongoSupporttrait ScalaFuturestrait Futurestrait PatienceConfigurationtrait AbstractPatienceConfigurationtrait ScaledTimeSpansclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait DefaultPlayMongoRepositorySupport[A]
Attributes
- Supertypes
-
trait TestSuitetrait Suitetrait Serializabletrait Assertionstrait TripleEqualstrait TripleEqualsSupporttrait MongoSupporttrait ScalaFuturestrait Futurestrait PatienceConfigurationtrait AbstractPatienceConfigurationtrait ScaledTimeSpansclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait DefaultPlayMongoRepositorySupport[A]