user function

UserRequestPostProcessor user(
  1. String username
)

Makes the request as the user username, already logged in: no password is checked.

The user has the password password and the role USER unless changed with the returned processor's methods.

MockRequestBuilder(HttpMethod.get, '/api/admin')
  ..with_(user('ada').roles(['ADMIN']));

Spring (Java): user("ada").roles("ADMIN").

Implementation

UserRequestPostProcessor user(String username) =>
    UserRequestPostProcessor._(username);