Hi,
I have written a Groovy script that reads a set of XML files, convert them into JSON and import them into a MongoDB collection (via the MongoDB
Java driver:
https://docs.mongodb.org/ecosystem/drivers/java/).
I would like to
unit test the connection to a local MongoDb instance and the retrieval of an existing db and collection. I am not sure which is the best way to go, but I have used Mocks (
Mockito library) in the past and I wonder whether this is actually what I should be doing. Here is some experimental code:
What is your view? Am I heading to the right direction?
Thank you,
I.