Testing Spring Boot Applications With MockMvc and @WebMvcTest

Philip Riecks 

Did you ever found yourself saying: I usually ignore testing my Spring Web MVC controller endpoints because the security setup is tricky. That belongs to the past. With

Read More

Spring Boot Test Slices: Overview and Usage

Philip Riecks 

Spring Boot offers great support to test different slices (web, database, etc.) of your application. This allows you to write tests for specific parts of your application in

Read More

Testing Spring Boot Applications with Kotlin and Testcontainers

Philip Riecks 

Recently I introduced Testcontainers for a Kotlin based Spring Boot application. I jumped right into the setup and immediately ran into an issue. Even though the interoperability of

Read More

Improve Build Times with Context Caching from Spring Test

Philip Riecks 

Nothing is more tiresome than long feedback cycles due to slow builds. I've recently invested one day to improve the integration test setup for a larger project. The

Read More

Write Integration Tests For Your Spring WebSocket Endpoints

Philip Riecks 

WebSockets allow establishing a full-duplex, two-way communication between the client and the server. With Spring WebSocket, we can bootstrap our WebSocket application in minutes. While there is excellent

Read More

Five JUnit 5 Features You Might Not Know Yet

Philip Riecks 

Writing your first test with JUnit 5 is straightforward. Annotate your test method with @Test and verify the result using assertions. Apart from the basic testing functionality of

Read More

Spring WebClient exchange vs. retrieve Comparison

Philip Riecks 

As the Spring Framework team won't add new features to the RestTemplate, the general recommendation is to start using the Spring WebFlux WebClient. Besides the reactive and non-blocking

Read More

Test Spring WebClient with MockWebServer from OkHttp

Philip Riecks 

In one of the last blog post, I demonstrated how to test the Spring RestTemplate with @RestClientTest. With this elegant solution, you can easily test parts of your

Read More

Reuse Containers With Testcontainers for Fast Integration Tests

Philip Riecks 

Testcontainers is now for almost a year part of my core testing libraries set. It allows you to control Docker containers for external parts of your application (e.g.

Read More

Thymeleaf OAuth2 Login with Spring Security and AWS Cognito

Philip Riecks 

Securing your frontend application with a login and managing a user pool is something you can either write for yourself or use an external identity provider for. If

Read More