Class BeanValidationTestStrategy

java.lang.Object
nablarch.test.core.entity.BeanValidationTestStrategy
All Implemented Interfaces:
ValidationTestStrategy

public class BeanValidationTestStrategy extends Object implements ValidationTestStrategy
Bean Validationを使用するときのValidationTestStrategy実装クラス。
  • 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:
      invokeValidation in interface ValidationTestStrategy
      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:
      validateParameters in interface ValidationTestStrategy
      Parameters:
      prefix - 入力値のマップに入ったキーのプレフィクス
      entityClass - テスト対象対象クラス名
      params - 入力値を表すマップ
      notUse - バリデーション対象メソッド名
      group - Bean Validationのグループ(Bean Validationを使用するときのみ有効)
      Returns:
      テスト用バリデーションコンテキスト
    • getGroupFromName

      public Class<?> getGroupFromName(String groupName)
      Description copied from interface: ValidationTestStrategy
      Bean Validationのグループを取得する。
      Specified by:
      getGroupFromName in interface ValidationTestStrategy
      Parameters:
      groupName - グループ名
      Returns:
      Bean Validationのグループ
    • createExpectedValidationResultMessage

      public nablarch.core.message.Message createExpectedValidationResultMessage(String propertyName, String messageString, Object[] options)
      Description copied from interface: ValidationTestStrategy
      メッセージ比較用のValidationResultMessageを生成する。
      Specified by:
      createExpectedValidationResultMessage in interface ValidationTestStrategy
      Parameters:
      propertyName - プロパティ名
      messageString - メッセージを特定する文字列
      options - オプションパラメータ
      Returns:
      ValidationResultMessage
    • createExpectedMessage

      public nablarch.core.message.Message createExpectedMessage(nablarch.core.message.MessageLevel level, String messageString, Object[] options)
      Description copied from interface: ValidationTestStrategy
      メッセージ比較用のMessageを生成する。
      Specified by:
      createExpectedMessage in interface ValidationTestStrategy
      Parameters:
      level - メッセージレベル
      messageString - メッセージを特定する文字列
      options - オプションパラメータ
      Returns:
      Message