Christopher Smith (Migrated from SEC-2997) said:
Most parameter bindings now support Optional, but @AuthenticationPrincipal doesn't. This causes some difficulties when trying to MockMvc-test controllers that use optional authentication, since my UserDetails doesn't have a default constructor and thus spinning up the entire Spring Security context is necessary just to get null passed to the method. Supporting Optional, which would let the MVC mapper supply the "null" on its own, would eliminate the need.
Currently, trying to use Optional with @AuthenticationPrincipal results in a _null_ Optional.
any plans for this?
Most helpful comment
any plans for this?