クラス ModelResultMatchers

java.lang.ObjectSE
org.springframework.test.web.servlet.result.ModelResultMatchers

public class ModelResultMatchers extends ObjectSE
モデルのアサーションのファクトリ。

このクラスのインスタンスは通常、MockMvcResultMatchers.model() を介してアクセスされます。

導入:
3.2
作成者:
Rossen Stoyanchev, Sam Brannen
  • コンストラクターの詳細

  • メソッドの詳細

    • attribute

      public <T> ResultMatcher attribute(StringSE name, Matcher<? super T> matcher)
      指定された Hamcrest Matcher でモデル属性値をアサートします。
    • attribute

      public ResultMatcher attribute(StringSE name, @Nullable ObjectSE value)
      モデル属性値をアサートします。
    • attributeExists

      public ResultMatcher attributeExists(StringSE... names)
      指定されたモデル属性が存在することを表明します。
    • attributeDoesNotExist

      public ResultMatcher attributeDoesNotExist(StringSE... names)
      指定されたモデル属性が存在しないことを表明します。
    • attributeErrorCount

      public ResultMatcher attributeErrorCount(StringSE name, int expectedCount)
      指定されたモデル属性にエラーがあることを表明します。
    • attributeHasErrors

      public ResultMatcher attributeHasErrors(StringSE... names)
      指定されたモデル属性にエラーがあることを表明します。
    • attributeHasNoErrors

      public ResultMatcher attributeHasNoErrors(StringSE... names)
      指定されたモデル属性にエラーがないことを表明します。
    • attributeHasFieldErrors

      public ResultMatcher attributeHasFieldErrors(StringSE name, StringSE... fieldNames)
      指定されたモデル属性フィールドにエラーがあることを表明します。
    • attributeHasFieldErrorCode

      public ResultMatcher attributeHasFieldErrorCode(StringSE name, StringSE fieldName, StringSE error)
      文字列の完全一致を使用して、モデル属性のフィールドエラーコードをアサートします。
      導入:
      4.1
    • attributeHasFieldErrorCode

      public ResultMatcher attributeHasFieldErrorCode(StringSE name, StringSE fieldName, Matcher<? super StringSE> matcher)
      Matcher を使用して、モデル属性のフィールドエラーコードをアサートします。
      導入:
      4.1
    • errorCount

      public ResultMatcher errorCount(int expectedCount)
      モデル内のエラーの総数をアサートします。
    • hasErrors

      public ResultMatcher hasErrors()
      モデルにエラーがあることを表明します。
    • hasNoErrors

      public ResultMatcher hasNoErrors()
      モデルにエラーがないことを表明します。
    • size

      public ResultMatcher size(int size)
      モデル属性の数をアサートします。