クラス AbstractMockHttpServletResponseAssert<SELF extends AbstractMockHttpServletResponseAssert<SELF,ACTUAL>,ACTUAL>

java.lang.ObjectSE
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractObjectAssert<SELF,ACTUAL>
org.springframework.test.web.servlet.assertj.AbstractHttpServletResponseAssert<MockHttpServletResponse,SELF,ACTUAL>
org.springframework.test.web.servlet.assertj.AbstractMockHttpServletResponseAssert<SELF,ACTUAL>
型パラメーター:
SELF - アサーションの種類
ACTUAL - アサートするオブジェクトの型
実装されたすべてのインターフェース:
org.assertj.core.api.Assert<SELF,ACTUAL>org.assertj.core.api.Descriptable<SELF>org.assertj.core.api.ExtensionPoints<SELF,ACTUAL>
既知の直属サブクラス
MvcTestResultAssert

public abstract class AbstractMockHttpServletResponseAssert<SELF extends AbstractMockHttpServletResponseAssert<SELF,ACTUAL>,ACTUAL> extends AbstractHttpServletResponseAssert<MockHttpServletResponse,SELF,ACTUAL>
導入:
6.2
作成者:
Stephane Nicoll
  • フィールドサマリー

    クラス org.assertj.core.api.AbstractAssert から継承されたフィールド

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • コンストラクターのサマリー

    コンストラクター
    修飾子
    コンストラクター
    説明
    protected
  • 方法の概要

    修飾子と型
    メソッド
    説明
    org.assertj.core.api.AbstractByteArrayAssert<?>
    レスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。
    テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。
    org.assertj.core.api.AbstractStringAssert<?>
    テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。
    転送された URL をテスト対象のオブジェクトとして使用する新しいアサーションオブジェクトを返します。
    レスポンス本文が指定された値と等しいことを確認します。
    HttpServletResponse.sendError(int, String)EE サーブレットエラーメッセージが指定された値と等しいことを確認します。
    転送された URL が指定された値と等しいことを確認します。
    hasRedirectedUrl(StringSE redirectedUrl)
    リダイレクトされた URL が指定された値と等しいことを確認します。
    リダイレクトされた URL をテストするオブジェクトとして使用する新しいアサーションオブジェクトを返します。

    クラス org.assertj.core.api.AbstractObjectAssert から継承されたメソッド

    as, as, doesNotReturn, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, hasOnlyFields, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison

    クラス org.assertj.core.api.AbstractAssert から継承されたメソッド

    actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    クラス java.lang.ObjectSE から継承されたメソッド

    clone, finalize, getClass, notify, notifyAll, toString, wait, waitSE, waitSE

    インターフェース org.assertj.core.api.Descriptable から継承されたメソッド

    as, describedAs, describedAs
  • コンストラクターの詳細

  • メソッドの詳細

    • bodyText

      public org.assertj.core.api.AbstractStringAssert<?> bodyText()
      テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。

      例:

      
       // Check that the response body is equal to "Hello World":
       assertThat(response).bodyText().isEqualTo("Hello World");
       
    • bodyJson

      public AbstractJsonContentAssert<?> bodyJson()
      テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。bodyText() と比較して、アサーションオブジェクトは専用の JSON サポートを提供します。

      例:

      
       // Check that the response body is strictly equal to the content of
       // "/com/acme/sample/person-created.json":
       assertThat(response).bodyJson()
               .isStrictlyEqualToJson("/com/acme/sample/person-created.json");
      
       // Check that the response is strictly equal to the content of the
       // specified file located in the same package as the PersonController:
       assertThat(response).bodyJson().withResourceLoadClass(PersonController.class)
               .isStrictlyEqualToJson("person-created.json");
       
      返されるアサートオブジェクトは、JSON パス式もサポートします。

      例:

      
       // Check that the JSON document does not have an "error" element
       assertThat(response).bodyJson().doesNotHavePath("$.error");
      
       // Check that the JSON document as a top level "message" element
       assertThat(response).bodyJson()
               .extractingPath("$.message").asString().isEqualTo("hello");
       
    • body

      public org.assertj.core.api.AbstractByteArrayAssert<?> body()
      レスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。
      関連事項:
    • forwardedUrl

      public UriAssert forwardedUrl()
      転送された URL をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。単純な等価性チェックが必要な場合は、代わりに hasForwardedUrl(String) の使用を検討してください。

      例:

      
       // Check that the forwarded URL starts with "/orders/":
       assertThat(response).forwardedUrl().matchPattern("/orders/*);
       
    • redirectedUrl

      public UriAssert redirectedUrl()
      リダイレクトされた URL をテストするオブジェクトとして使用する新しいアサーションオブジェクトを返します。単純な等価性チェックが必要な場合は、代わりに hasRedirectedUrl(String) の使用を検討してください。

      例:

      
       // Check that the redirected URL starts with "/orders/":
       assertThat(response).redirectedUrl().matchPattern("/orders/*);
       
    • hasBodyTextEqualTo

      public SELF hasBodyTextEqualTo(StringSE bodyText)
      レスポンス本文が指定された値と等しいことを確認します。
    • hasForwardedUrl

      public SELF hasForwardedUrl(@Nullable StringSE forwardedUrl)
      転送された URL が指定された値と等しいことを確認します。
      パラメーター:
      forwardedUrl - 転送されると予想される URL (null でもかまいません)
    • hasRedirectedUrl

      public SELF hasRedirectedUrl(@Nullable StringSE redirectedUrl)
      リダイレクトされた URL が指定された値と等しいことを確認します。
      パラメーター:
      redirectedUrl - 予想されるリダイレクト URL (null でもかまいません)
    • hasErrorMessage

      public SELF hasErrorMessage(@Nullable StringSE errorMessage)
      HttpServletResponse.sendError(int, String)EE サーブレットエラーメッセージが指定された値と等しいことを確認します。
      パラメーター:
      errorMessage - 予想されるサーブレットエラーメッセージ (null でもかまいません)
      導入:
      6.2.1