クラス 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コンストラクターの概要
コンストラクター修飾子コンストラクター説明protectedAbstractMockHttpServletResponseAssert(@Nullable HttpMessageContentConverter converter, ACTUAL actual, ClassSE<?> selfType) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。protectedAbstractMockHttpServletResponseAssert(@Nullable JsonConverterDelegate converterDelegate, ACTUAL actual, ClassSE<?> selfType) メソッドのサマリー
修飾子と型メソッド説明org.assertj.core.api.AbstractByteArrayAssert<?> body()レスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。bodyJson()テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。org.assertj.core.api.AbstractStringAssert<?> bodyText()テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。転送された URL をテスト対象のオブジェクトとして使用する新しいアサーションオブジェクトを返します。hasBodyTextEqualTo(StringSE bodyText) レスポンス本文が指定された値と等しいことを確認します。hasErrorMessage(@Nullable StringSE errorMessage) HttpServletResponse.sendError(int, String)サーブレットエラーメッセージが指定された値と等しいことを確認します。hasForwardedUrl(@Nullable StringSE forwardedUrl) 転送された URL が指定された値と等しいことを確認します。hasRedirectedUrl(@Nullable StringSE redirectedUrl) リダイレクトされた URL が指定された値と等しいことを確認します。リダイレクトされた URL をテストするオブジェクトとして使用する新しいアサーションオブジェクトを返します。クラス AbstractHttpServletResponseAssert から継承されたメソッド
containsHeader, contentType, doesNotContainHeader, getResponse, hasContentType, hasContentType, hasContentTypeCompatibleWith, hasContentTypeCompatibleWith, hasHeader, hasStatus, hasStatus, hasStatus1xxInformational, hasStatus2xxSuccessful, hasStatus3xxRedirection, hasStatus4xxClientError, hasStatus5xxServerError, hasStatusOk, headersクラス 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クラス ObjectSE から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.assertj.core.api.Descriptable から継承されたメソッド
as, describedAs, describedAs
コンストラクターの詳細
AbstractMockHttpServletResponseAssert
protected AbstractMockHttpServletResponseAssert(@Nullable JsonConverterDelegate converterDelegate, ACTUAL actual, ClassSE<?> selfType) AbstractMockHttpServletResponseAssert
@DeprecatedSE(since="7.0", forRemoval=true) protected AbstractMockHttpServletResponseAssert(@Nullable HttpMessageContentConverter converter, ACTUAL actual, ClassSE<?> selfType) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。
メソッドの詳細
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
テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。bodyText()と比較して、アサーションオブジェクトは専用の JSON サポートを提供します。例:
返されるアサートオブジェクトは、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");例:
// 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
転送された URL をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。単純な等価性チェックが必要な場合は、代わりにhasForwardedUrl(String)の使用を検討してください。例:
// Check that the forwarded URL starts with "/orders/": assertThat(response).forwardedUrl().matchPattern("/orders/*);redirectedUrl
リダイレクトされた URL をテストするオブジェクトとして使用する新しいアサーションオブジェクトを返します。単純な等価性チェックが必要な場合は、代わりにhasRedirectedUrl(String)の使用を検討してください。例:
// Check that the redirected URL starts with "/orders/": assertThat(response).redirectedUrl().matchPattern("/orders/*);hasBodyTextEqualTo
hasForwardedUrl
hasRedirectedUrl
hasErrorMessage