Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ad2d820

Browse files
authored
docs: Remove mentioning of Fongo (#692)
Change text as the example test case no longer uses Fongo. Add the EmbeddedMongoClient trait to the documentation as the example is not complete without it. Mention that the test examples now use testcontainers. Close #154
1 parent 1ea56ba commit ad2d820

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/src/docs/asciidoc/testing.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ To write unit tests with MongoDB and Spock you can simply extend from `grails.te
44
uses by default a `MongoClient` instance that connects to a MongoDB instance as defined in your configuration
55
(by default, `localhost` and port `27017`, see <<gettingStarted>> for more details):
66

7+
It is preferable to use testcontainers to automatically run MongoDB in a containerized environment and not have to run a MongoDB instance locally. The following examples use testcontainers:
8+
9+
[source,groovy]
10+
----
11+
include::{sourcedir}/examples/grails3-mongodb/src/test/groovy/functional/tests/EmbeddedMongoClient.groovy[]
12+
----
13+
714
[source,groovy]
815
----
916
include::{sourcedir}/examples/grails3-mongodb/src/test/groovy/functional/tests/LocalMongoUnitSpec.groovy[tags=structure]
1017
----
1118

12-
You can also provide your own `MongoClient` instance to use something such as https://github.com/fakemongo/fongo[Fongo],
13-
as shown in the following example:
19+
You can also use your own low-level `MongoClient` instance, as shown in the following example:
1420

1521
[source,groovy]
1622
----

0 commit comments

Comments
 (0)