как я могу издеваться над ReactiveSecurityContextHolder в тестах, чтобы можно было попасть в лямбду flatmap
flatmap
ReactiveSecurityContextHolder.getContext() .map(SecurityContext::getAuthentication) .flatMap(authentication -> {})
Вам просто нужно добавить @WithMockUser("customUserName") на тесте.
@WithMockUser("customUserName")