How to test any HTTP Client of your Spring Boot Application with MockServer

In an integration test, we want to test the interaction of several components of our application. However, as soon as one of these components communicates with a 3rd party service via HTTP, this can present us with a challenge. To be independent of this service, we have to mock it. In this blog post, I will show you how to do that with the help of MockServer.

[Read More]

How to test the REST Clients of your Spring Boot Application with @RestClientTest

In this Blogpost, I will show you how to test the REST Clients of your Spring Boot Application with @RestClientTest. We will implement a repository that will fetch its data from the Star Wars API. By using the MockRestServiceServer we are going to mock the real API, to isolate our tests and fake inputs for our REST client to test its behavior. In the last part, I will show you how you can isolate the individual tests from another.

[Read More]