1

Below data is getting stored in mongodb :-

_id:5b072863d285a8331b3e34f3
CaId:"1334401849"
Account:28255305
Code:"CAPITAL EXPENDITURES/IMPROVEMENTS: 554"
Amount:"5"
PrPercent:"45"
InPercent:"55"
ContactID:-1
TradeDate:2018-05-24 16:01:28.093
SettleDate:2018-06-09 00:00:00.000
TrCode:"CHECKDSB"
DiType:"NONE"
Comment:"hdfghdfghdfgh"
Status:"Pending"

Now If I want to fetch this data from mongo , starting from setting up connection with db , to fetching the data

I am using Rest assured for automating API tests using spring boot , so there are quite a few mongo related libraries which can be utilized.

So how to get started with this ?

Ashh
  • 44,693
  • 14
  • 105
  • 132

1 Answers1

-1

How are you going to run these tests? Will you be testing it on a real instance of your service or as part of the unit tests? If the later, I would strongly suggest to use something else than a connection to a real MongoDB instance: e.g. this embedded MongoDB library https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo or Fongo.

Also check out this link Embedded MongoDB when running integration tests