Java - Blog
-
Power up your integration tests with Mock Server Apr 2, 2025
What is Mock Server? Mock Server is a considerably useful tool when testing integrations against HTTP services. It is especially useful for integration tests. With Mock Server, it is possible to launch an HTTP server within our test suite and define how it should behave when receiving specific requests from a client application. Additionally, Mock Server is able to verify that the client is making the expected requests when a particular execution flow is being executed. In what scenarios is Mock Server useful? API First Development: If you are using the API First development methodology, Mock Server can be helpful...
-
Test containers with Spring Boot. Persistence layer integration testing Jul 28, 2024
Nowadays, there is no doubt that the quality of software and its flexibility are directly linked to the ability to verify if it still works after a change, a refactor or a new functionality. Time and effort are dedicated developing automated tests for our applications in order to keep adapting to changes while making sure our software keeps doing what it was doing before. A technology that can help us considerably when verifying that our software works as expected is Test containers. Test containers is an open-source framework that allows us to deploy infrastructure dependencies of our application when running...
-
Java 21 service with virtual threads performance test May 15, 2024
I’m back to share the results of a comparison I was curious about: comparing the scalability of a simple microservice developed with Spring Boot. The idea behind this exercise is to test how Virtual Threads (one of the most famous Java 21 new features) impact on service availability. The service will be responsible for providing a simple REST API to store, read, modify, and delete locations in a PostgreSQL database. The code is available in the GitHub repository spring-boot-location-api. In order to develop this microservice I’ve used the traditional technological stack of Spring Boot, with the Spring Web and Spring...