From the course: Advanced Spring: Effective Integration Testing with Spring Boot

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Write tests for a custom query

Challenge: Write tests for a custom query

From the course: Advanced Spring: Effective Integration Testing with Spring Boot

Start my 1-month free trial

Challenge: Write tests for a custom query

(soft music) - [Instructor] So far, we haven't really introduced any customizations. And there is a very little risk involved that we have introduced bugs in our application. In this challenge, we want you to create a custom query that is able to fetch average grades for active students. First, you should extend the student class with new attributes boolean active and int grade. Grade can be anything between zero and 100. Next you'll write a failing test by pre-existing a couple of students and verifying average grade. And finally write an implementation for a custom query. This challenge should take about 5 to 10 minutes. When you're done, or if you get stuck, you can check out my solution widow to see how I solved the challenge.

Contents