public class ContentRequestMatchers extends ObjectSE
RequestMatcher のファクトリ。このクラスのインスタンスには、通常 MockRestRequestMatchers.content() を介してアクセスします。| 修飾子 | コンストラクターと説明 |
|---|---|
protected | ContentRequestMatchers() 直接インスタンス化用ではなく、クラスコンストラクター。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
RequestMatcher | bytes(byte[] expectedContent) リクエストの本文を指定されたバイト配列と比較します。 |
RequestMatcher | contentType(MediaType expectedContentType) リクエストコンテンツ型を MediaType としてアサートします。 |
RequestMatcher | contentType(StringSE expectedContentType) リクエストのコンテンツ型を文字列としてアサートします。 |
RequestMatcher | contentTypeCompatibleWith(MediaType contentType) リクエストコンテンツ型が MediaType.isCompatibleWith(MediaType) で定義されている特定のコンテンツ型と互換性があることをアサートします。 |
RequestMatcher | contentTypeCompatibleWith(StringSE contentType) リクエストコンテンツ型が MediaType.isCompatibleWith(MediaType) で定義されている特定のコンテンツ型と互換性があることをアサートします。 |
RequestMatcher | formData(MultiValueMap<StringSE, StringSE> expectedContent) 本体をフォームデータとして解析し、指定された MultiValueMap と比較します。 |
RequestMatcher | node(org.hamcrest.Matcher<? super NodeSE> matcher) リクエストコンテンツを NodeSE として解析し、指定された Matcher を適用します。 |
RequestMatcher | source(org.hamcrest.Matcher<? super SourceSE> matcher) リクエストコンテンツを DOMSourceSE として解析し、指定された Matcher を適用します。 |
RequestMatcher | string(org.hamcrest.Matcher<? super StringSE> matcher) リクエストの本文を UTF-8 文字列として取得し、指定された Matcher を適用します。 |
RequestMatcher | string(StringSE expectedContent) リクエストの本文を UTF-8 文字列として取得し、指定された文字列と比較します。 |
RequestMatcher | xml(StringSE expectedXmlContent) リクエストの本文と指定された文字列を XML として解析し、2 つが「類似している」ことを表明します |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEprotected ContentRequestMatchers()
MockRestRequestMatchers.content() を使用します。public RequestMatcher contentType(StringSE expectedContentType)
public RequestMatcher contentType(MediaType expectedContentType)
MediaType としてアサートします。public RequestMatcher contentTypeCompatibleWith(StringSE contentType)
MediaType.isCompatibleWith(MediaType) で定義されている特定のコンテンツ型と互換性があることをアサートします。public RequestMatcher contentTypeCompatibleWith(MediaType contentType)
MediaType.isCompatibleWith(MediaType) で定義されている特定のコンテンツ型と互換性があることをアサートします。public RequestMatcher string(org.hamcrest.Matcher<? super StringSE> matcher)
Matcher を適用します。public RequestMatcher string(StringSE expectedContent)
public RequestMatcher bytes(byte[] expectedContent)
public RequestMatcher formData(MultiValueMap<StringSE,StringSE> expectedContent)
MultiValueMap と比較します。public RequestMatcher xml(StringSE expectedXmlContent)
このマッチャーの使用は、XMLUnit ライブラリが利用可能であることを前提としています。
expectedXmlContent - 予期される XML コンテンツ public RequestMatcher node(org.hamcrest.Matcher<? super NodeSE> matcher)
NodeSE として解析し、指定された Matcher を適用します。public RequestMatcher source(org.hamcrest.Matcher<? super SourceSE> matcher)
DOMSourceSE として解析し、指定された Matcher を適用します。