[[new]]
== What's New in Spring Security 5.1

Spring Security 5.1 provides a number of new features.
Below are the highlights of the release.

=== New Features

* <<test-method>>
** Support for customizing when the `SecurityContext` is setup in the test
For example, `@WithMockUser(setupBefore = TestExecutionEvent.TEST_EXECUTION)` will setup a user after JUnit's `@Before` and before the test executes.
** `@WithUserDetails` now works with `ReactiveUserDetailsService`
* <<jackson>> - added support for `BadCredentialsException`
* <<mvc-authentication-principal>>
** Supports resolving beans in WebFlux (was already supported in Spring MVC)
** Supports resolving `errorOnInvalidType` in WebFlux (was already supported in Spring MVC)
