Package nablarch.test.core.entity
Class NablarchValidationTestStrategy
java.lang.Object
nablarch.test.core.entity.NablarchValidationTestStrategy
- All Implemented Interfaces:
ValidationTestStrategy
Nablarch 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 groupKey) Bean Validationのグループを取得する。invokeValidation(Class<?> entityClass, String targetPropertyName, String[] paramValues, Class<?> notUse) 単一のプロパティについて、バリデーションを実行する。validateParameters(String prefix, Class<?> entityClass, Map<String, String[]> params, String validateFor, Class<?> notUse) 入力全体のバリデーションを実行する。
-
Constructor Details
-
NablarchValidationTestStrategy
public NablarchValidationTestStrategy()
-
-
Method Details
-
invokeValidation
public ValidationTestContext invokeValidation(Class<?> entityClass, String targetPropertyName, String[] paramValues, Class<?> notUse) Description copied from interface:ValidationTestStrategy単一のプロパティについて、バリデーションを実行する。- Specified by:
invokeValidationin interfaceValidationTestStrategy- Parameters:
entityClass- テスト対象対象クラス名targetPropertyName- バリデーション対象プロパティ名paramValues- パラメータとして使用する値notUse- Bean Validationのグループ(Bean Validationを使用するときのみ有効)- Returns:
- テスト用バリデーションコンテキスト
-
validateParameters
public ValidationTestContext validateParameters(String prefix, Class<?> entityClass, Map<String, String[]> params, String validateFor, Class<?> notUse) Description copied from interface:ValidationTestStrategy入力全体のバリデーションを実行する。- Specified by:
validateParametersin interfaceValidationTestStrategy- Parameters:
prefix- 入力値のマップに入ったキーのプレフィクスentityClass- テスト対象対象クラス名params- 入力値を表すマップvalidateFor- バリデーション対象メソッド名notUse- Bean Validationのグループ(Bean Validationを使用するときのみ有効)- Returns:
- テスト用バリデーションコンテキスト
-
getGroupFromName
Bean Validationのグループを取得する。 Nablarch Validationではグループを使用しないため、常にnullを返却する。- Specified by:
getGroupFromNamein interfaceValidationTestStrategy- Parameters:
groupKey- グループ名- 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
-