クラス 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
AbstractMockHttpServletResponseAssert
(HttpMessageContentConverter contentConverter, ACTUAL actual, ClassSE<?> selfType) 方法の概要
修飾子と型メソッド説明org.assertj.core.api.AbstractByteArrayAssert<?>
body()
レスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。bodyJson()
テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。org.assertj.core.api.AbstractStringAssert<?>
bodyText()
テキストに変換されたレスポンス本文をテスト対象オブジェクトとして使用する新しいアサーションオブジェクトを返します。転送された URL をテスト対象のオブジェクトとして使用する新しいアサーションオブジェクトを返します。hasBodyTextEqualTo
(StringSE bodyText) レスポンス本文が指定された値と等しいことを確認します。hasErrorMessage
(StringSE errorMessage) HttpServletResponse.sendError(int, String)
EE サーブレットエラーメッセージが指定された値と等しいことを確認します。hasForwardedUrl
(StringSE forwardedUrl) 転送された URL が指定された値と等しいことを確認します。hasRedirectedUrl
(StringSE redirectedUrl) リダイレクトされた URL が指定された値と等しいことを確認します。リダイレクトされた URL をテストするオブジェクトとして使用する新しいアサーションオブジェクトを返します。クラス org.springframework.test.web.servlet.assertj.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
クラス java.lang.ObjectSE から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.assertj.core.api.Descriptable から継承されたメソッド
as, describedAs, describedAs
コンストラクターの詳細
AbstractMockHttpServletResponseAssert
protected AbstractMockHttpServletResponseAssert(@Nullable HttpMessageContentConverter contentConverter, ACTUAL actual, ClassSE<?> selfType)
メソッドの詳細
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
転送された URL が指定された値と等しいことを確認します。- パラメーター:
forwardedUrl
- 転送されると予想される URL (null でもかまいません)
hasRedirectedUrl
リダイレクトされた URL が指定された値と等しいことを確認します。- パラメーター:
redirectedUrl
- 予想されるリダイレクト URL (null でもかまいません)
hasErrorMessage
HttpServletResponse.sendError(int, String)
EE サーブレットエラーメッセージが指定された値と等しいことを確認します。- パラメーター:
errorMessage
- 予想されるサーブレットエラーメッセージ (null でもかまいません)- 導入:
- 6.2.1