Fixes gh-4425
This commit is contained in:
Johnny Lim 2017-06-29 16:56:16 +09:00 committed by Rob Winch
parent 93ac706d86
commit cdcf65de1e
1 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ import java.util.function.Supplier;
/**
* Test utilities for working with Spring Security and
* {{@link org.springframework.test.web.reactive.server.WebTestClient.Builder#apply(WebTestClientConfigurer)}}.
* {@link org.springframework.test.web.reactive.server.WebTestClient.Builder#apply(WebTestClientConfigurer)}.
*
* @author Rob Winch
* @since 5.0
@ -71,7 +71,7 @@ public class SecurityMockServerConfigurers {
* Updates the ServerWebExchange to use the provided Authentication as the Principal
*
* @param authentication the Authentication to use.
* @return the {@link WebTestClientConfigurer}} to use
* @return the configurer to use
*/
public static <T extends WebTestClientConfigurer & MockServerConfigurer> T mockAuthentication(Authentication authentication) {
return (T) new MutatorWebTestClientConfigurer(() -> Mono.just(authentication).map(SecurityContextImpl::new));
@ -82,7 +82,7 @@ public class SecurityMockServerConfigurers {
* the Principal
*
* @param userDetails the UserDetails to use.
* @return the {@link WebTestClientConfigurer} to use
* @return the configurer to use
*/
public static <T extends WebTestClientConfigurer & MockServerConfigurer> T mockUser(UserDetails userDetails) {
return mockAuthentication(new UsernamePasswordAuthenticationToken(userDetails, userDetails.getPassword(), userDetails.getAuthorities()));