Integration & Slice Testing
Learn Integration & Slice Testing (Testing, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Business Requirement The insurance handout builds a complete Spring Boot application: a Policy entity, a PolicyRepository , a PolicyServiceImpl and a PolicyController exposing /getAll , /save , /get/{id} and /delete/{id} over MySQL. The only test it writes is a service test with a mocked repository. Everything above and below that service is verified by opening Postman and looking at the response by hand. Problem Statement : the mocked service test passes even when the URL mapping is wrong, the JSON field names are wrong, the derived query does not compile, the column name does not exist and...