Package nablarch.test.core.entity
Class BeanValidationTestStrategy
java.lang.Object
nablarch.test.core.entity.BeanValidationTestStrategy
- All Implemented Interfaces:
ValidationTestStrategy
Bean Validationを使用するときの
ValidationTestStrategy実装クラス。-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateExpectedMessage(MessageLevel level, String messageString, Object[] options) メッセージ比較用のMessageを生成する。createExpectedValidationResultMessage(String propertyName, String messageString, Object[] options) メッセージ比較用のValidationResultMessageを生成する。Class<?>getGroupFromName(String groupName) Bean Validationのグループを取得する。invokeValidation(Class<?> entityClass, String targetPropertyName, String[] paramValues, Class<?> group) 単一のプロパティについて、バリデーションを実行する。validateParameters(String prefix, Class<?> entityClass, Map<String, String[]> params, String notUse, Class<?> group) 入力全体のバリデーションを実行する。
-
Constructor Details
-
BeanValidationTestStrategy
public BeanValidationTestStrategy()
-
-
Method Details
-
invokeValidation
public ValidationTestContext invokeValidation(Class<?> entityClass, String targetPropertyName, String[] paramValues, Class<?> group) Description copied from interface:ValidationTestStrategy単一のプロパティについて、バリデーションを実行する。- Specified by:
invokeValidationin interfaceValidationTestStrategy- Parameters:
entityClass- テスト対象対象クラス名targetPropertyName- バリデーション対象プロパティ名paramValues- パラメータとして使用する値group- Bean Validationのグループ(Bean Validationを使用するときのみ有効)- Returns:
- テスト用バリデーションコンテキスト
-
validateParameters
public ValidationTestContext validateParameters(String prefix, Class<?> entityClass, Map<String, String[]> params, String notUse, Class<?> group) Description copied from interface:ValidationTestStrategy入力全体のバリデーションを実行する。- Specified by:
validateParametersin interfaceValidationTestStrategy- Parameters:
prefix- 入力値のマップに入ったキーのプレフィクスentityClass- テスト対象対象クラス名params- 入力値を表すマップnotUse- バリデーション対象メソッド名group- Bean Validationのグループ(Bean Validationを使用するときのみ有効)- Returns:
- テスト用バリデーションコンテキスト
-
getGroupFromName
Description copied from interface:ValidationTestStrategyBean Validationのグループを取得する。- Specified by:
getGroupFromNamein interfaceValidationTestStrategy- Parameters:
groupName- グループ名- Returns:
- Bean Validationのグループ
-
createExpectedValidationResultMessage
public Message createExpectedValidationResultMessage(String propertyName, String messageString, Object[] options) Description copied from interface:ValidationTestStrategyメッセージ比較用のValidationResultMessageを生成する。- Specified by:
createExpectedValidationResultMessagein interfaceValidationTestStrategy- Parameters:
propertyName- プロパティ名messageString- メッセージを特定する文字列options- オプションパラメータ- Returns:
ValidationResultMessage
-
createExpectedMessage
Description copied from interface:ValidationTestStrategyメッセージ比較用のMessageを生成する。- Specified by:
createExpectedMessagein interfaceValidationTestStrategy- Parameters:
level- メッセージレベルmessageString- メッセージを特定する文字列options- オプションパラメータ- Returns:
Message
-