public class DefaultRequestExpectation extends ObjectSE implements RequestExpectation
RequestExpectation
のデフォルト実装。修飾子と型 | クラスと説明 |
---|---|
protected static class | DefaultRequestExpectation.RequestCount 実際のリクエスト数と予想されるリクエスト数を追跡するヘルパークラス。 |
コンストラクターと説明 |
---|
DefaultRequestExpectation(ExpectedCount expectedCount, RequestMatcher requestMatcher) RequestCount で示されるように、何度も呼び出される必要がある新しいリクエストの期待値を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
ResponseActions | andExpect(RequestMatcher requestMatcher) リクエストの期待値を追加します。 |
void | andRespond(ResponseCreator responseCreator) レスポンスを定義します。 |
ClientHttpResponse | createResponse(ClientHttpRequest request) 5.0.3 の時点で、意図的にブロックする可能性のあるレスポンスの作成は、リクエストカウントの追跡から分離され、このメソッドはカウントを透過的にインクリメントしないことに注意してください。 |
protected DefaultRequestExpectation.RequestCount | getRequestCount() |
protected ListSE<RequestMatcher> | getRequestMatchers() |
protected ResponseCreator | getResponseCreator() |
boolean | hasRemainingCount() この期待に対する呼び出しの残りのカウントがあるかどうか。 |
void | incrementAndValidate() 一致するリクエスト数を増やし、最大数に達していないことを確認します。 |
boolean | isSatisfied() このリクエスト予測の要件が満たされているかどうか。 |
void | match(ClientHttpRequest request) 指定されたリクエストを特定の期待値と照合します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public DefaultRequestExpectation(ExpectedCount expectedCount, RequestMatcher requestMatcher)
RequestCount
で示されるように、何度も呼び出される必要がある新しいリクエストの期待値を作成します。expectedCount
- 期待されるリクエスト expectedCountprotected DefaultRequestExpectation.RequestCount getRequestCount()
protected ListSE<RequestMatcher> getRequestMatchers()
@Nullable protected ResponseCreator getResponseCreator()
public ResponseActions andExpect(RequestMatcher requestMatcher)
ResponseActions
ResponseActions
の andExpect
public void andRespond(ResponseCreator responseCreator)
ResponseActions
ResponseActions
の andRespond
responseCreator
- レスポンスの作成者 public void match(ClientHttpRequest request) throws IOExceptionSE
RequestMatcher
RequestMatcher
の match
request
- アサーションを作成するリクエスト IOExceptionSE
- I/O エラーの場合 public ClientHttpResponse createResponse(@Nullable ClientHttpRequest request) throws IOExceptionSE
incrementAndValidate()
を個別に呼び出す必要があります。ResponseCreator
の createResponse
request
- リクエスト IOExceptionSE
public boolean hasRemainingCount()
RequestExpectation
RequestExpectation
の hasRemainingCount
public void incrementAndValidate()
RequestExpectation
RequestExpectation
の incrementAndValidate
public boolean isSatisfied()
RequestExpectation
RequestExpectation
の isSatisfied