Package kong.unirest.core
Class Routes
- java.lang.Object
-
- kong.unirest.core.Routes
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Invocation>invokesprivate HttpMethodmethodprivate java.lang.Stringpath
-
Constructor Summary
Constructors Constructor Description Routes(HttpMethod method, Path p)Routes(HttpRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddInvoke(Invocation invocation)private HeadersallHeaders()(package private) RawResponseexchange(HttpRequest request, Config config)private java.util.Optional<Invocation>getBestMatch(HttpRequest request)private java.util.Optional<Invocation>getBestMatch(HttpRequest request, boolean expected)(package private) HttpMethodgetMethod()(package private) java.lang.StringgetPath()AsserthadBody(java.lang.String expected)Assert that any the request sent this body.AsserthadField(java.lang.String name, java.lang.String value)Assert that any the request sent a multipart fieldAsserthadHeader(java.lang.String key, java.lang.String value)Assert that any request to this method/path contained this header(package private) booleanmatches(HttpMethod httpMethod, Path url)(package private) booleanmatches(HttpRequest request)(package private) ExpectationnewExpectation()private java.lang.IntegersumInvokes()AssertverifyAll()verify that all Expectations were fulfilled at least once.AssertwasInvokedTimes(int i)assert that this instance of method/path was invoked x times
-
-
-
Field Detail
-
path
private final java.lang.String path
-
method
private final HttpMethod method
-
invokes
private final java.util.List<Invocation> invokes
-
-
Constructor Detail
-
Routes
Routes(HttpRequest request)
-
Routes
public Routes(HttpMethod method, Path p)
-
-
Method Detail
-
newExpectation
Expectation newExpectation()
-
matches
boolean matches(HttpRequest request)
-
exchange
RawResponse exchange(HttpRequest request, Config config)
-
matches
boolean matches(HttpMethod httpMethod, Path url)
-
getBestMatch
private java.util.Optional<Invocation> getBestMatch(HttpRequest request)
-
getBestMatch
private java.util.Optional<Invocation> getBestMatch(HttpRequest request, boolean expected)
-
hadHeader
public Assert hadHeader(java.lang.String key, java.lang.String value)
Description copied from interface:AssertAssert that any request to this method/path contained this header
-
hadBody
public Assert hadBody(java.lang.String expected)
Description copied from interface:AssertAssert that any the request sent this body. this only applies to non-multipart requests.
-
hadField
public Assert hadField(java.lang.String name, java.lang.String value)
Description copied from interface:AssertAssert that any the request sent a multipart field
-
allHeaders
private Headers allHeaders()
-
wasInvokedTimes
public Assert wasInvokedTimes(int i)
Description copied from interface:Assertassert that this instance of method/path was invoked x times- Specified by:
wasInvokedTimesin interfaceAssert- Parameters:
i- the number of times invoked.- Returns:
- this Assert instance
-
sumInvokes
private java.lang.Integer sumInvokes()
-
verifyAll
public Assert verifyAll()
Description copied from interface:Assertverify that all Expectations were fulfilled at least once.
-
getMethod
HttpMethod getMethod()
-
getPath
java.lang.String getPath()
-
addInvoke
void addInvoke(Invocation invocation)
-
-