public abstract class MockRestRequestMatchers extends ObjectSE
RequestMatcher
クラスの静的ファクトリメソッド。通常、MockRestServiceServer.expect(RequestMatcher)
に入力を提供するために使用されます。このクラスを Java エディターのお気に入りとして追加することを検討してください。この設定に移動するには、設定を開き、「お気に入り」と入力します。
コンストラクターと説明 |
---|
MockRestRequestMatchers() |
修飾子と型 | メソッドと説明 |
---|---|
static RequestMatcher | anything() どんなリクエストにもマッチします。 |
static ContentRequestMatchers | content() ボディマッチャーをリクエストするためのアクセス。 |
static RequestMatcher | header(StringSE name, Matcher<? super StringSE>... matchers) 指定された Hamcrest マッチャーでリクエストヘッダー値をアサートします。 |
static RequestMatcher | header(StringSE name, StringSE... expectedValues) リクエストヘッダー値をアサートします。 |
static RequestMatcher | headerDoesNotExist(StringSE name) 指定されたリクエストヘッダーが存在しないことをアサートします。 |
static <T> RequestMatcher | jsonPath(StringSE expression, Matcher<T> matcher) JsonPath 式を使用してボディの特定のサブセットをインスペクションし、JSON パスで見つかった値をアサートするための Hamcrest 一致を使用して、ボディマッチャーをリクエストするアクセス。 |
static JsonPathRequestMatchers | jsonPath(StringSE expression, ObjectSE... args) JsonPath 式を使用してボディマッチャーをリクエストして、ボディの特定のサブセットをインスペクションするためのアクセス。 |
static RequestMatcher | method(HttpMethod method) リクエストの HttpMethod をアサートします。 |
static RequestMatcher | queryParam(StringSE name, Matcher<? super StringSE>... matchers) 指定された Hamcrest マッチャーでリクエストクエリパラメーター値をアサートします。 |
static RequestMatcher | queryParam(StringSE name, StringSE... expectedValues) リクエストクエリパラメーター値をアサートします。 |
static RequestMatcher | requestTo(Matcher<StringSE> matcher) 指定された Hamcrest マッチャーでリクエスト URI 文字列をアサートします。 |
static RequestMatcher | requestTo(StringSE expectedUri) 指定された文字列に一致するリクエスト URI をアサートします。 |
static RequestMatcher | requestTo(URISE uri) 指定された URI へのリクエストを期待します。 |
static RequestMatcher | requestToUriTemplate(StringSE expectedUri, ObjectSE... uriVars) エンコーディングを含む UriComponentsBuilder を介して URI テンプレートとオプション変数から URI を準備する requestTo(URI) のバリアント。 |
static XpathRequestMatchers | xpath(StringSE expression, MapSE<StringSE, StringSE> namespaces, ObjectSE... args) XPath を使用してボディの特定のサブセットをインスペクションするレスポンスボディマッチャーへのアクセス。 |
static XpathRequestMatchers | xpath(StringSE expression, ObjectSE... args) XPath を使用してボディマッチャーをリクエストして、ボディの特定のサブセットをインスペクションするアクセス。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static RequestMatcher anything()
public static RequestMatcher method(HttpMethod method)
HttpMethod
をアサートします。method
- HTTP メソッド public static RequestMatcher requestTo(Matcher<StringSE> matcher)
matcher
- 予想される URI の文字列マッチャー public static RequestMatcher requestTo(StringSE expectedUri)
expectedUri
- 期待される URIpublic static RequestMatcher requestToUriTemplate(StringSE expectedUri, ObjectSE... uriVars)
UriComponentsBuilder
を介して URI テンプレートとオプション変数から URI を準備する requestTo(URI)
のバリアント。expectedUri
- 予想される URI テンプレート uriVars
- 予期される URI を設定するための 0 個以上の URI 変数 public static RequestMatcher requestTo(URISE uri)
uri
- 期待される URI@SafeVarargsSE public static RequestMatcher queryParam(StringSE name, Matcher<? super StringSE>... matchers)
public static RequestMatcher queryParam(StringSE name, StringSE... expectedValues)
@SafeVarargsSE public static RequestMatcher header(StringSE name, Matcher<? super StringSE>... matchers)
public static RequestMatcher header(StringSE name, StringSE... expectedValues)
public static RequestMatcher headerDoesNotExist(StringSE name)
public static ContentRequestMatchers content()
public static JsonPathRequestMatchers jsonPath(StringSE expression, ObjectSE... args)
String.format(String, Object...)
SE で定義されているフォーマット指定子を使用してパラメーター化された文字列にすることができます。expression
- オプションで引数でパラメーター化された JSON パス args
- JSON パス式をパラメーター化する引数 public static <T> RequestMatcher jsonPath(StringSE expression, Matcher<T> matcher)
expression
- JSON パス式 matcher
- JSON パスで期待される値のマッチャー public static XpathRequestMatchers xpath(StringSE expression, ObjectSE... args) throws XPathExpressionExceptionSE
String.format(String, Object...)
SE で定義されているフォーマット指定子を使用してパラメーター化された文字列にすることができます。expression
- オプションで引数でパラメーター化された XPathargs
- XPath 式をパラメーター化する引数 XPathExpressionExceptionSE
public static XpathRequestMatchers xpath(StringSE expression, MapSE<StringSE,StringSE> namespaces, ObjectSE... args) throws XPathExpressionExceptionSE
String.format(String, Object...)
SE で定義されているフォーマット指定子を使用してパラメーター化された文字列にすることができます。expression
- オプションで引数でパラメーター化された XPathnamespaces
- XPath 式で参照される名前空間 args
- XPath 式をパラメーター化する引数 XPathExpressionExceptionSE