From the course: Advanced Spring: Effective Integration Testing with Spring Boot
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Writing integration tests for rest endpoints
From the course: Advanced Spring: Effective Integration Testing with Spring Boot
Writing integration tests for rest endpoints
- [Instructor] So far, we have written a student service app with integration tests covering all layers, but how can we ensure it can be consumed by other applications? Let's dive in and write a consumer for a service and see how we can write a meaningful integration test even when the student service is not available. Head over to start.spring.io. As the Group name, choose com.linkedIn and as the Artifact use student-client. We can leave other configurations as default, choose Java 15. In the dependencies select Project lombok, Spring Reactive Web and stub runner click on generate go to downloads directory and open it between your ID. This is our client application. We'll start by first writing a test that can create a client which can talk to our service. Using the TDD approach, we first need to write a failing test. Let's create a new class student client test and annotate it with Spring Boot test we will need a student client that will talk to our service. Since it doesn't exist…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.