After you have finished this exercise, you understand how you can write the required table level assertions when you are writing integration tests for code that updates the information of an existing row. You can finish this exercise by following these steps:
1. Open the UpdateTodoItemTest
class that’s found from the com.cleantestautomation.assertjdb.todoitem
package.
2. Write the table level assertion which ensures that the system under test doesn’t insert a new row into the todo_item
table or delete a row from the todo_item
table when the updated todo item isn’t found from the database. You have to add this assertion to the shouldNotInsertNewTodoItemsIntoDatabaseOrDeleteTodoItemsFromDatabase()
method that’s found from the WhenUpdatedTodoItemIsNotFound
class.
3. Write the table level assertion which ensures that the system under test doesn’t insert a new row into the todo_item
table or delete a row from the todo_item
table when the updated todo item is found from the database. You have to add this assertion to the shouldNotInsertNewTodoItemsIntoDatabaseOrDeleteTodoItemsFromDatabase()
method that’s found from the WhenUpdatedTodoItemIsFound
class.
4. Run the tests found from the UpdateTodoItemTest
class and make sure that they pass.