I have a short question about EntityManager
.
I have a method updateAdmin(Admin a)
.
Behaviour:
This method should update an existing Admin in my database.
Return true if an admin exist an the update was successful.
Return false if the Admin that has to be updated does not exist in the database.
Now I want to write a JUnit test method.
I can check that the updateAdmin(Admin a)
method returns a true
if the Admin is already in the database and the update was successful.
I also can check that the method returns false
if the Admin
does not exist.
But how can I check that the database was not changed and the update was not successful??
Thanks for your answer! :)