Tuesday, 17 September 2013

Verify that a new record is inserted to the database successfully

Verify that a new record is inserted to the database successfully

How do i verify that an object A added to the database successfully?
MongoTemplate.save() method doesn't return any value to verify its action
result. I found a way is to initiate value if A.Id before i save A to
database using MongoTemplate.save() method, and the retrieve back the
saved record using that Id value, but that way doesn't satisfy me. How do
i verify that while keep the Id field generated by the database?

No comments:

Post a Comment