クラス SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
java.lang.ObjectSE
org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
- 実装されたすべてのインターフェース:
org.springframework.test.web.servlet.request.RequestPostProcessor
- 含まれているクラス:
- SecurityMockMvcRequestPostProcessors
public static final class SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
extends ObjectSE
implements org.springframework.test.web.servlet.request.RequestPostProcessor
- 導入:
- 4.0
メソッドのサマリー
修飾子と型メソッド説明authorities
(CollectionSE<? extends GrantedAuthority> authorities) ユーザーのGrantedAuthority
にデータを入力します。authorities
(GrantedAuthority... authorities) ユーザーのGrantedAuthority
にデータを入力します。ユーザーのパスワードを入力します。org.springframework.mock.web.MockHttpServletRequest
postProcessRequest
(org.springframework.mock.web.MockHttpServletRequest request) 認証するユーザーのロールを指定します。
メソッドの詳細
roles
認証するユーザーのロールを指定します。この方法はauthorities(GrantedAuthority...)
に似ていますが、柔軟性がありません。- パラメーター:
roles
- 設定するロール。ロールがROLE_PREFIX
で始まらない場合は、自動的に追加されることに注意してください。これは、デフォルトでroles("ROLE_USER")
とroles("USER")
が同等であることを意味します。- 戻り値:
- さらなるカスタマイズのための UserRequestPostProcessor
- 関連事項:
authorities(GrantedAuthority...)
ROLE_PREFIX
authorities
public SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor authorities(GrantedAuthority... authorities) ユーザーのGrantedAuthority
にデータを入力します。デフォルトは ROLE_USER です。- パラメーター:
authorities
-- 戻り値:
- さらなるカスタマイズのための UserRequestPostProcessor
- 関連事項:
authorities
public SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor authorities(CollectionSE<? extends GrantedAuthority> authorities) ユーザーのGrantedAuthority
にデータを入力します。デフォルトは ROLE_USER です。- パラメーター:
authorities
-- 戻り値:
- さらなるカスタマイズのための UserRequestPostProcessor
- 関連事項:
password
ユーザーのパスワードを入力します。デフォルトは "password" です- パラメーター:
password
- ユーザーのパスワード- 戻り値:
- さらなるカスタマイズのための UserRequestPostProcessor
postProcessRequest
public org.springframework.mock.web.MockHttpServletRequest postProcessRequest(org.springframework.mock.web.MockHttpServletRequest request) - 次で指定:
- インターフェース
org.springframework.test.web.servlet.request.RequestPostProcessor
のpostProcessRequest