Spring Web Services
Exercise: Todo REST Service Testing
The objective of this exercise is to implement different tests for the RESTful todo web service.
Assignment
- Add the Spring starter
spring-boot-starter-test
and the REST-assured library io.rest-assured:rest-assured
to the Maven project
- Add an SQL file
data.sql
that inserts some test data into the H2 database and set the application property spring.jpa.defer-datasource-initialization
to true
- Implement integration tests of the todo web service using
- Configure the Maven Failsafe plugin to run the integration tests
Solution