Quick revision
The short answer
Spring Framework 5 introduced WebFlux, a reactive web stack built on Project Reactor, together with WebClient, set a Java 8 baseline with functional bean registration, added first-class Kotlin support including a router DSL, offered functional endpoints with RouterFunction, which reached Spring MVC in 5.2, and integrated JUnit 5 into the TestContext framework with SpringExtension and @SpringJUnitConfig. WebFlux, WebClient, functional endpoints, Kotlin support and the JUnit 5 integration are still central in Spring 6 and 7. Some 5.x choices were later replaced: RestTemplate is in maintenance in favour of RestClient since 6.1, and the javax namespace moved to jakarta in 6.
What to remember
In this answer, we went through Spring Framework 5: the reactive WebFlux stack on Reactor with WebClient, the Java 8 baseline with functional bean registration, first-class Kotlin support, functional RouterFunction endpoints that reached MVC in 5.2, and the JUnit 5 integration with SpringExtension and @SpringJUnitConfig. Most of these are still central in Spring 6 and 7, while RestTemplate has given way to RestClient and javax to jakarta.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Spring Framework 5 introduced WebFlux, a reactive web stack built on Project Reactor, together with WebClient, set a Java 8 baseline with functional bean registration, added first-class Kotlin support including a router DSL, offered functional endpoints with RouterFunction, which reached Spring MVC in 5.2, and integrated JUnit 5 into the TestContext framework with SpringExtension and @SpringJUnitConfig. WebFlux, WebClient, functional endpoints, Kotlin support and the JUnit 5 integration are still central in Spring 6 and 7. Some 5.x choices were later replaced: RestTemplate is in maintenance in favour of RestClient since 6.1, and the javax namespace moved to jakarta in 6.
Why this question is asked
Spring Framework 5, released in 2017, was the biggest change to Spring since annotations. It added a second, reactive web stack beside Spring MVC, embraced Java 8 features and Kotlin, and modernised testing. Much of what we use today in Spring 6 and 7 started there, which is why interviewers ask what it brought: it shows whether we know where today's features came from and which older habits are now outdated. In this answer, we will go through the reactive stack and WebClient, the Java 8 baseline with functional registration and Kotlin, functional endpoints, the JUnit 5 integration, and finally what has since been replaced.
1WebFlux, Reactor and WebClient
The headline feature was Spring WebFlux, a web framework for non-blocking applications. In Spring MVC, each request holds a thread until the response is written, so a thread waiting on a slow database is blocked and wasted. WebFlux is built on Project Reactor, a library of reactive types: Mono for zero or one value and Flux for a stream of values. A handler returns a Mono or Flux immediately, and a small number of event-loop threads deliver the result when it is ready.
With it came WebClient, a non-blocking HTTP client with a fluent API. It is still the reactive HTTP client in Spring 6 and 7, and it can also be used from MVC applications that need to call several services concurrently.
2Java 8 Baseline, Functional Registration and Kotlin
Spring 5 required Java 8, so the framework itself could use lambdas, method references, Optional and default methods. One visible result was functional bean registration: instead of annotations and reflection, we can register a bean with a Supplier, a lambda that creates it.
Kotlin support arrived in the same release. Spring added Kotlin extensions, null-safety annotations on its APIs so Kotlin could see which values may be null, and a Kotlin DSL for bean definitions and for routes. That same nullness work evolved into the JSpecify annotations of Framework 7, and Kotlin support grew further with coroutines in 5.2.
3Functional Endpoints With RouterFunction
Besides annotated controllers, WebFlux offered functional endpoints: routes declared as code with RouterFunction and handled by HandlerFunction lambdas. This style keeps routing in one place and makes it explicit, which some teams prefer to scanning annotations. Spring MVC received the same model, WebMvc.fn, in 5.2, so it is not limited to reactive applications.
4JUnit 5 in the TestContext Framework
Spring 5 integrated JUnit 5, the Jupiter programming model, into the Spring TestContext framework. SpringExtension plugs Spring into JUnit, and composed annotations such as @SpringJUnitConfig combine the extension with the context configuration. Constructor injection into test classes also became possible. Spring Boot's @SpringBootTest builds on the same extension, and it is still how Spring tests are written in Spring 6 and 7, now with JUnit 6 support in the newest generation; check your versions.
5What Stayed and What Was Replaced
Looking back from Spring 7, most of Spring 5's additions are still central: WebFlux and Reactor for reactive services, WebClient as the reactive client, functional endpoints in both stacks, Kotlin support and the JUnit integration. A few things changed course. RestTemplate, the classic blocking client, is in maintenance mode, and since 6.1 RestClient offers a modern fluent API for blocking calls. The javax.* Java EE packages that Spring 5 used moved to jakarta.* in Spring 6. And for many teams, virtual threads in modern Java now offer a simpler way to scale blocking code, so WebFlux is chosen for streaming and backpressure needs rather than by default.
| Spring 5 feature | Status in Spring 6 and 7 |
|---|---|
| WebFlux on Reactor | central for reactive and streaming services |
| WebClient | still the reactive HTTP client |
| Functional bean registration | still supported, extended in 7 |
| Kotlin support and DSLs | central, null safety now via JSpecify |
RouterFunction endpoints | in WebFlux, and in MVC since 5.2 |
JUnit 5 SpringExtension | standard way to write Spring tests |
RestTemplate as main client | maintenance mode, RestClient since 6.1 |
| javax Java EE packages | replaced by jakarta in Spring 6 |
6Follow-up questions
Should a new Spring 7 service use WebFlux or MVC?
For most request-response services, Spring MVC, possibly with virtual threads, is simpler to write, debug and test. WebFlux makes sense when the service streams data, needs backpressure, or is a gateway handling very many concurrent slow connections, and when the team is comfortable with reactive code.
Was WebClient meant to replace RestTemplate?
For a while the Spring documentation pointed blocking users to WebClient, which pulled reactive dependencies into MVC applications just to make HTTP calls. RestClient in 6.1 fixed that by giving blocking code a modern fluent client on the same infrastructure, so today RestClient is the choice for blocking calls and WebClient for reactive ones.
What else did Spring 5 add that people forget?
It added a candidate component index for faster scanning, which was later deprecated in favour of AOT processing, HTTP/2 support through Servlet 4, and the @Nullable annotations on its own APIs that paved the way for Kotlin null safety.
7Conclusion
In this answer, we went through Spring Framework 5: the reactive WebFlux stack on Reactor with WebClient, the Java 8 baseline with functional bean registration, first-class Kotlin support, functional RouterFunction endpoints that reached MVC in 5.2, and the JUnit 5 integration with SpringExtension and @SpringJUnitConfig. Most of these are still central in Spring 6 and 7, while RestTemplate has given way to RestClient and javax to jakarta.
Open with
Spring 5 came out in 2017 and its biggest addition was WebFlux, a non-blocking web stack built on Project Reactor, with Mono and Flux as return types, plus WebClient, the reactive HTTP client.
Then, if they want more
It also raised the baseline to Java 8, so the framework used lambdas internally and offered functional bean registration with suppliers, and it added first-class Kotlin support with extensions, null-safety annotations and DSLs for beans and routes. Functional endpoints with RouterFunction came with WebFlux, and Spring MVC got the same model in 5.2.
On the testing side, it integrated JUnit 5 into the TestContext framework with SpringExtension and composed annotations like @SpringJUnitConfig.
In Spring 6 and 7, most of that is still central: WebFlux and WebClient for reactive and streaming services, functional endpoints in both stacks, Kotlin support, whose null-safety annotations evolved into JSpecify in 7, and the JUnit integration that Spring Boot tests build on. A few things were replaced.
RestTemplate is in maintenance mode, and since 6.1 RestClient is the modern blocking client. And the javax packages moved to jakarta in Spring 6. I would also add that with virtual threads, MVC is often the simpler default now, and WebFlux is chosen when streaming or backpressure really matters.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- JUnit 5, Java 8, Spring Framework 5, JUnit 6
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Framework reference, Core technologies
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "What were the main features introduced in Spring Framework 5, and which of them are...": https://scrivio-interview-library.netlify.app/spring-boot/spring-framework-evolution/f3057ae814/