postProcessRequest method
Returns the request to perform instead of request; usually
request itself after changing its headers, cookies, attributes or
principal.
Implementation
@override
MockServerHttpRequest postProcessRequest(MockServerHttpRequest request) {
final user = User.withUsername(_username)
.password(_password)
.authorities(_authorities)
.build();
return _withContext(
request,
UsernamePasswordAuthenticationToken.authenticated(
user,
user.password,
user.authorities,
),
);
}