Spring is evolving a lot, Spring 3.3 was released this year in May. I had the opportunity to see the news during the Spring.IO event, and now Spring 3.4 has been released at the end of November.
If you want to see the highlights from Spring IO event, I’ve talked about it here:
Spring Boot 3.4.0
These are the highlights from Spring team about Spring 3.4.0
Structured logging
Support for defining additional beans of the same type as those that are auto-configured
Expanded virtual thread support
Improved support for Docker Compose and Testcontainers
Numerous Actuator enhancements, including info and health information for SSL certificates
Improved image building capabilities, including out-of-the-box support for ARM
Auto-configuration for
MockMvcTester
, an AssertJ-based alternative toMockMvc
Let’s talk about some of them.
MockMvcTester
Spring Boot 3.4 uses Spring Framework 6.2 which gives us the MockMvcTester, this is a good tool for writing integration testing. With it, we can write more fluent tests. If you wish to know more about it, I wrote about it here:
MockBean
If you upgrade your application to Spring Boot 3.4 you will see that @MockBean
and @SpyBean
have been deprecated in favor of @MockitoBean
and @MockitoSpyBean
These annotations are deprecated for removal in Spring Boot 3.6.0, so it is important to update them.
If you would like to know more about it, check it out here: @MockitoBean and @MockitoSpyBean.
Upgrade your application
To upgrade your application you should read the release notes from Spring Spring Boot 3.4 Release Notes, but you can also try to automate the migration using OpenRewrite. It is not ready yet, however, you can have a look here: https://github.com/openrewrite/rewrite-spring/issues/642
Another good way to keep updated is to have a look at the InfoQ article about it, They have done an interview with the Spring team, and there are a lot of interesting information: Spring Framework 6.2 and Spring Boot 3.4 Improve Containers, Actuators Ahead of New 2025 Generations - InfoQ
Conclusion
There is some news in Spring 3.4, I’ve talked about two of them. If you are a Java developer, you should read the release notes to be ready to upgrade your services.
For more details about the news: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.4-Release-Notes