Uses of Interface
kong.unirest.core.ExpectedResponse
Packages that use ExpectedResponse
-
Uses of ExpectedResponse in kong.unirest.core
Methods in kong.unirest.core that return ExpectedResponseModifier and TypeMethodDescriptionMockClient.defaultResponse()return this status for any request that doesn't match a expectationstatic ExpectedResponseExpectedResponse.of(int status) Create a independent expected response. useful for systems creating test-doubles rather than strict mockingExpectation.thenReturn()expect a null responseExpectation.thenReturn(Object pojo) expect a object response as defined by a pojo using the requests / configuration object mapperExpectation.thenReturn(String body) expect a string responseExpectation.thenReturn(Supplier<String> supplier) A supplier for the expected body which will get invoked at the time of build the response.Expectation.thenReturn(JSONElement jsonObject) expect a json responseExpectedResponse.thenReturn(Object pojo) expect a object response as defined by a pojo using the requests / configuration object mapperExpectedResponse.thenReturn(String body) expect a string responseExpectedResponse.thenReturn(Supplier<String> supplier) A supplier for the expected body which will get invoked at the time of build the response.ExpectedResponse.thenReturn(JSONElement jsonObject) expect a json responseExpectedResponse.withHeader(String key, String value) adds a header to the expected responseExpectedResponse.withHeaders(Headers headers) adds a collection of headers to the expected responseExpectedResponse.withStatus(int httpStatus) sets the status of the expected responseExpectedResponse.withStatus(int httpStatus, String statusMessage) sets the status of the expected responseMethod parameters in kong.unirest.core with type arguments of type ExpectedResponseModifier and TypeMethodDescriptionvoidExpectation.thenReturn(Function<HttpRequest<?>, ExpectedResponse> fun) Allows for a full override of the way a expected response is built.