Class GetMockMvcResponseResultSupplier
- java.lang.Object
-
- ru.tinkoff.qa.neptune.core.api.steps.SequentialGetStepSupplier<T,R,T,R,THIS>
-
- ru.tinkoff.qa.neptune.core.api.steps.SequentialGetStepSupplier.GetSimpleStepSupplier<MockMvcContext,org.springframework.mock.web.MockHttpServletResponse,GetMockMvcResponseResultSupplier>
-
- ru.tinkoff.qa.neptune.spring.mock.mvc.GetMockMvcResponseResultSupplier
-
- All Implemented Interfaces:
Cloneable
,Supplier<Function<MockMvcContext,org.springframework.mock.web.MockHttpServletResponse>>
,StepParameterPojo
public final class GetMockMvcResponseResultSupplier extends SequentialGetStepSupplier.GetSimpleStepSupplier<MockMvcContext,org.springframework.mock.web.MockHttpServletResponse,GetMockMvcResponseResultSupplier>
This class is designed to create a step that receives a response and then gets some value
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ru.tinkoff.qa.neptune.core.api.steps.SequentialGetStepSupplier
SequentialGetStepSupplier.DefaultGetParameterReader, SequentialGetStepSupplier.DefineCriteriaParameterName, SequentialGetStepSupplier.DefineFromParameterName, SequentialGetStepSupplier.DefineGetImperativeParameterName, SequentialGetStepSupplier.DefinePollingTimeParameterName, SequentialGetStepSupplier.DefineResultDescriptionParameterName, SequentialGetStepSupplier.DefineTimeOutParameterName, SequentialGetStepSupplier.GetArrayChainedStepSupplier<T,R,M,THIS extends SequentialGetStepSupplier.GetArrayChainedStepSupplier<T,R,M,THIS>>, SequentialGetStepSupplier.GetArrayStepSupplier<T,R,THIS extends SequentialGetStepSupplier.GetArrayStepSupplier<T,R,THIS>>, SequentialGetStepSupplier.GetListChainedStepSupplier<T,S extends Iterable<R>,M,R,THIS extends SequentialGetStepSupplier.GetListChainedStepSupplier<T,S,M,R,THIS>>, SequentialGetStepSupplier.GetListStepSupplier<T,S extends Iterable<R>,R,THIS extends SequentialGetStepSupplier.GetListStepSupplier<T,S,R,THIS>>, SequentialGetStepSupplier.GetObjectChainedStepSupplier<T,R,M,THIS extends SequentialGetStepSupplier.GetObjectChainedStepSupplier<T,R,M,THIS>>, SequentialGetStepSupplier.GetObjectFromArrayChainedStepSupplier<T,R,M,THIS extends SequentialGetStepSupplier.GetObjectFromArrayChainedStepSupplier<T,R,M,THIS>>, SequentialGetStepSupplier.GetObjectFromArrayStepSupplier<T,R,THIS extends SequentialGetStepSupplier.GetObjectFromArrayStepSupplier<T,R,THIS>>, SequentialGetStepSupplier.GetObjectFromIterableChainedStepSupplier<T,R,M,THIS extends SequentialGetStepSupplier.GetObjectFromIterableChainedStepSupplier<T,R,M,THIS>>, SequentialGetStepSupplier.GetObjectFromIterableStepSupplier<T,R,THIS extends SequentialGetStepSupplier.GetObjectFromIterableStepSupplier<T,R,THIS>>, SequentialGetStepSupplier.GetObjectStepSupplier<T,R,THIS extends SequentialGetStepSupplier.GetObjectStepSupplier<T,R,THIS>>, SequentialGetStepSupplier.GetSimpleStepSupplier<T,R,THIS extends SequentialGetStepSupplier.GetSimpleStepSupplier<T,R,THIS>>
-
-
Field Summary
-
Fields inherited from class ru.tinkoff.qa.neptune.core.api.steps.SequentialGetStepSupplier
toReport
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,String>
additionalParameters()
Returns additional parameters calculated during step executionGetMockMvcResponseResultSupplier
expectContent(String expectedString)
Assert the response body content as a String.GetMockMvcResponseResultSupplier
expectContent(Function<org.springframework.test.web.servlet.result.ContentResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts content in fluent wayGetMockMvcResponseResultSupplier
expectContent(org.hamcrest.Matcher<? super String> stringMatcher)
Assert the response body content with a HamcrestMatcher
.<T> GetMockMvcResponseResultSupplier
expectContent(T serialized)
Assert the response body content as a String.<T> GetMockMvcResponseResultSupplier
expectContent(T serialized, DataTransformer dataTransformer)
Assert the response body content as a String.GetMockMvcResponseResultSupplier
expectContentBytes(byte[] expectedBytes)
Assert the response body content as a byte array.GetMockMvcResponseResultSupplier
expectContentEncoding(String encoding)
Assert the character encoding in the ServletResponse.GetMockMvcResponseResultSupplier
expectContentEncoding(Charset characterEncoding)
Assert the character encoding in the ServletResponse.GetMockMvcResponseResultSupplier
expectContentType(String contentType)
Assert the ServletResponse content type.GetMockMvcResponseResultSupplier
expectContentType(org.springframework.http.MediaType contentType)
Assert the ServletResponse content type after parsing it as a MediaType.GetMockMvcResponseResultSupplier
expectCookie(String name)
Assert a cookie exists.GetMockMvcResponseResultSupplier
expectCookie(Function<org.springframework.test.web.servlet.result.CookieResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts cookie in fluent wayGetMockMvcResponseResultSupplier
expectCookieComment(String name, String comment)
Assert a cookie's comment.GetMockMvcResponseResultSupplier
expectCookieComment(String name, org.hamcrest.Matcher<? super String> matcher)
Assert a cookie's comment with a HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectCookieDomain(String name, String domain)
Assert a cookie's domain.GetMockMvcResponseResultSupplier
expectCookieDomain(String name, org.hamcrest.Matcher<? super String> matcher)
Assert a cookie's domain with a HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectCookieHttpOnly(String name, boolean httpOnly)
Assert whether the cookie must be HTTP only.GetMockMvcResponseResultSupplier
expectCookieMaxAge(String name, int maxAge)
Assert a cookie's maxAge.GetMockMvcResponseResultSupplier
expectCookieMaxAge(String name, org.hamcrest.Matcher<? super Integer> matcher)
Assert a cookie's maxAge with a HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectCookiePath(String name, String path)
Assert a cookie's path.GetMockMvcResponseResultSupplier
expectCookiePath(String name, org.hamcrest.Matcher<? super String> matcher)
Assert a cookie's path with a HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectCookieSecure(String name, boolean secure)
Assert whether the cookie must be sent over a secure protocol or not.GetMockMvcResponseResultSupplier
expectCookieValue(String name, String value)
Assert a cookie value.GetMockMvcResponseResultSupplier
expectCookieValue(String name, org.hamcrest.Matcher<? super String> valueMatcher)
Assert a cookie value with the given HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectCookieVersion(String name, int version)
Assert a cookie's version.GetMockMvcResponseResultSupplier
expectCookieVersion(String name, org.hamcrest.Matcher<? super Integer> matcher)
Assert a cookie's version with a HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectFlash(Function<org.springframework.test.web.servlet.result.FlashAttributeResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts flash attributes in fluent wayGetMockMvcResponseResultSupplier
expectFlashAttribute(String attribute, Object value)
Assert a flash attribute's value.<T> GetMockMvcResponseResultSupplier
expectFlashAttribute(String attribute, org.hamcrest.Matcher<? super T> matcherValue)
Assert a flash attribute's value with the given HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectFlashAttributeCount(int count)
Assert the number of flash attributes.GetMockMvcResponseResultSupplier
expectFlashAttributes(String... names)
Assert the existence of the given flash attributes.GetMockMvcResponseResultSupplier
expectForward(String expectedUrl)
Asserts the request was forwarded to the given URL.GetMockMvcResponseResultSupplier
expectForwardPattern(String urlPattern)
Asserts the request was forwarded to the given URL.GetMockMvcResponseResultSupplier
expectForwardTemplate(String urlTemplate, Object... uriVars)
Asserts the request was forwarded to the given URL template.GetMockMvcResponseResultSupplier
expectHandler(Function<org.springframework.test.web.servlet.result.HandlerResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts handlers in fluent way<T,R>
GetMockMvcResponseResultSupplierexpectHandlerCall(Class<T> handlerType, Function<T,R> getCallResult)
Assert the controller method used to process the request.GetMockMvcResponseResultSupplier
expectHandlerMethod(Method method)
Assert the controller method used to process the request.GetMockMvcResponseResultSupplier
expectHandlerMethod(String methodName)
Assert the name of the controller method used to process the request.GetMockMvcResponseResultSupplier
expectHandlerMethod(org.hamcrest.Matcher<? super String> methodNameMatcher)
Assert the name of the controller method used to process the request using the given HamcrestMatcher
.<T> GetMockMvcResponseResultSupplier
expectHandlerType(Class<T> handlerType)
Assert the type of the handler that processed the request.GetMockMvcResponseResultSupplier
expectHeader(String headerName)
Assert that the named response header exists.GetMockMvcResponseResultSupplier
expectHeader(Function<org.springframework.test.web.servlet.result.HeaderResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts header in fluent wayGetMockMvcResponseResultSupplier
expectHeaderValue(String headerName, String value)
Assert the primary value of the response header as a String value.GetMockMvcResponseResultSupplier
expectHeaderValue(String headerName, org.hamcrest.Matcher<? super String> valueMatcher)
Assert the primary value of the response header with the given Hamcrest StringMatcher
.GetMockMvcResponseResultSupplier
expectHeaderValues(String headerName, String... values)
Assert the values of the response header as String values.GetMockMvcResponseResultSupplier
expectHeaderValues(String headerName, org.hamcrest.Matcher<? super Iterable<String>> valuesMatcher)
Assert the values of the response header with the given Hamcrest IterableMatcher
.GetMockMvcResponseResultSupplier
expectJsonContent(String expectedJsonContent)
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.GetMockMvcResponseResultSupplier
expectJsonContent(String expectedJsonContent, boolean strict)
Parse the response content and the given string as JSON and assert the two are "similar" - i.e.GetMockMvcResponseResultSupplier
expectJsonPath(String expression, Object... jsonPathArgs)
Evaluate the JSON path expression against the response content and assert that a non-null value, possibly an empty array or map, exists at the given path.GetMockMvcResponseResultSupplier
expectJsonPath(String expression, Function<org.springframework.test.web.servlet.result.JsonPathResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher, Object... jsonPathArgs)
Evaluate the JSON path expression against the response and assert the result in fluent way<T> GetMockMvcResponseResultSupplier
expectJsonPath(String expression, org.hamcrest.Matcher<? super T> matcher, Class<T> targetType, Object... jsonPathArgs)
Evaluate the JSON path expression against the response content and assert the resulting value is read into value of expected type and suits the given matcher.GetMockMvcResponseResultSupplier
expectJsonPathValue(String expression, Object value, Object... jsonPathArgs)
Evaluate the JSON path expression against the response content and assert that the result is equal to the supplied value.<T> GetMockMvcResponseResultSupplier
expectJsonPathValue(String expression, org.hamcrest.Matcher<? super T> matcher, Object... jsonPathArgs)
Evaluate the JSON path expression against the response content and assert the resulting value with the given HamcrestMatcher
GetMockMvcResponseResultSupplier
expectModel(Function<org.springframework.test.web.servlet.result.ModelResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts model in fluent wayGetMockMvcResponseResultSupplier
expectModelAttribute(String attribute, Object value)
Assert a model attribute value.<T> GetMockMvcResponseResultSupplier
expectModelAttribute(String attribute, org.hamcrest.Matcher<? super T> matcher)
Assert a model attribute value with the given HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectModelAttributes(String... attributes)
Assert the given model attributes exist.GetMockMvcResponseResultSupplier
expectNoResolvedException()
Asserts that there is no exception raised by a handler and successfully resolved through aHandlerExceptionResolver
.GetMockMvcResponseResultSupplier
expectRedirect(String expectedUrl)
Asserts the request was redirected to the given URL.GetMockMvcResponseResultSupplier
expectRedirectPattern(String urlPattern)
Asserts the request was redirected to the given URL.GetMockMvcResponseResultSupplier
expectRedirectTemplate(String urlTemplate, Object... uriVars)
Asserts the request was redirected to the given URL template.GetMockMvcResponseResultSupplier
expectRequest(Function<org.springframework.test.web.servlet.result.RequestResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts the request in fluent wayGetMockMvcResponseResultSupplier
expectResolvedException()
Asserts that there is an exception raised by a handler and successfully resolved through aHandlerExceptionResolver
<T extends Exception>
GetMockMvcResponseResultSupplierexpectResolvedException(Class<T> exceptionClass)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolver
is an object of the defined class (not of any subclass)<T extends Exception>
GetMockMvcResponseResultSupplierexpectResolvedException(Class<T> exceptionClass, String message)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolver
is an object of the defined class (not of any subclass) and has defined message<T extends Exception>
GetMockMvcResponseResultSupplierexpectResolvedException(Class<T> exceptionClass, org.hamcrest.Matcher<? super String>... messageMatchers)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolver
is an object of the defined class (not of any subclass) and has a message that suits defined HamcrestMatcher
GetMockMvcResponseResultSupplier
expectResolvedException(org.hamcrest.Matcher<? super Throwable>... matchers)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolver
with a HamcrestMatcher
GetMockMvcResponseResultSupplier
expectStatus(int expected)
Assert the response status code is equal to an integer valueGetMockMvcResponseResultSupplier
expectStatus(Function<org.springframework.test.web.servlet.result.StatusResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts the response status in fluent wayGetMockMvcResponseResultSupplier
expectStatus(org.hamcrest.Matcher<? super Integer> matcher)
Assert the response status code with the given HamcrestMatcher
GetMockMvcResponseResultSupplier
expectStatusIs1xxInformational()
Assert the response status code is in the 1xx range.GetMockMvcResponseResultSupplier
expectStatusIs2xxSuccessful()
Assert the response status code is in the 2xx range.GetMockMvcResponseResultSupplier
expectStatusIs3xxRedirection()
Assert the response status code is in the 3xx range.GetMockMvcResponseResultSupplier
expectStatusIs4xxClientError()
Assert the response status code is in the 4xx range.GetMockMvcResponseResultSupplier
expectStatusIs5xxServerError()
Assert the response status code is in the 5xx range.GetMockMvcResponseResultSupplier
expectStatusReason(String reason)
Assert the Servlet response error message.GetMockMvcResponseResultSupplier
expectStatusReason(org.hamcrest.Matcher<? super String> matcher)
Assert the Servlet response error message with the given HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectView(Function<org.springframework.test.web.servlet.result.ViewResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts view in fluent wayGetMockMvcResponseResultSupplier
expectViewName(String name)
Assert the selected view name.GetMockMvcResponseResultSupplier
expectViewName(org.hamcrest.Matcher<? super String> nameMatcher)
Assert the selected view name with the given HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectXmlContent(String xmlContent)
Parse the response content and the given string as XML and assert the two are "similar" - i.e.GetMockMvcResponseResultSupplier
expectXPath(String expression, Object... xPathArgs)
Evaluate the XPath and assert that content exists.GetMockMvcResponseResultSupplier
expectXPath(String expression, Function<org.springframework.test.web.servlet.result.XpathResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher, Object... xPathArgs)
Evaluate the xPath expression against the response and assert the result in fluent wayGetMockMvcResponseResultSupplier
expectXPath(String expression, Map<String,String> namespaces, Object... xPathArgs)
Evaluate the XPath and assert that content exists.GetMockMvcResponseResultSupplier
expectXPath(String expression, Map<String,String> namespaces, Function<org.springframework.test.web.servlet.result.XpathResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher, Object... xPathArgs)
Evaluate the xPath expression against the response and assert the result in fluent wayGetMockMvcResponseResultSupplier
expectXPathNode(String expression, Map<String,String> namespaces, org.hamcrest.Matcher<? super Node> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNode
content found with the given HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectXPathNode(String expression, org.hamcrest.Matcher<? super Node> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNode
content found with the given HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectXPathNodeCount(String expression, int count, Object... xPathArgs)
Evaluate the XPath and assert the number of nodes found.GetMockMvcResponseResultSupplier
expectXPathNodeCount(String expression, Map<String,String> namespaces, int count, Object... xPathArgs)
Evaluate the XPath and assert the number of nodes found.GetMockMvcResponseResultSupplier
expectXPathNodeList(String expression, Map<String,String> namespaces, org.hamcrest.Matcher<? super NodeList> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNodeList
content found with the given HamcrestMatcher
.GetMockMvcResponseResultSupplier
expectXPathNodeList(String expression, org.hamcrest.Matcher<? super NodeList> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNodeList
content found with the given HamcrestMatcher
.protected void
onFailure(MockMvcContext mockMvcContext, Throwable throwable)
Some additional action if the step is failedprotected void
onSuccess(org.springframework.mock.web.MockHttpServletResponse mockHttpServletResponse)
Some additional action if the step is successfulstatic GetMockMvcResponseResultSupplier
response(org.springframework.test.web.servlet.MockMvc mockMvc, org.springframework.test.web.servlet.RequestBuilder builder)
Creates a step that gets a response.static GetMockMvcResponseResultSupplier
response(org.springframework.test.web.servlet.RequestBuilder builder)
Creates a step that gets a response.<T,R>
GetArrayFromResponse<T>thenGetArray(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T[]> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get an array from deserialized response content - then returns items of the array (all items or ones that match defined criteria)<T> GetArrayFromResponse<T>
thenGetArray(String description, com.fasterxml.jackson.core.type.TypeReference<T[]> tRef)
Creates a step that: - deserializes content of body of the received response to array - then returns items of the array (all items or ones that match defined criteria)<T,R>
GetArrayFromResponse<T>thenGetArray(String description, Class<R> tClass, Function<R,T[]> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get an array from deserialized response content - then returns items of the array (all items or ones that match defined criteria)<T> GetArrayFromResponse<T>
thenGetArray(String description, Class<T[]> tClass)
Creates a step that: - deserializes content of body of the received response to array - then returns items of the array (all items or ones that match defined criteria)<T,R>
GetArrayFromResponse<T>thenGetArray(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T[]> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get an array from deserialized response content - then returns items of the array (all items or ones that match defined criteria)<T> GetArrayFromResponse<T>
thenGetArray(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<T[]> tRef)
Creates a step that: - deserializes content of body of the received response to array - then returns items of the array (all items or ones that match defined criteria)<T,R>
GetArrayFromResponse<T>thenGetArray(String description, DataTransformer transformer, Class<R> tClass, Function<R,T[]> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get an array from deserialized response content - then returns items of the array (all items or ones that match defined criteria)<T> GetArrayFromResponse<T>
thenGetArray(String description, DataTransformer transformer, Class<T[]> tClass)
Creates a step that: - deserializes content of body of the received response to array - then returns items of the array (all items or ones that match defined criteria)<T> GetObjectFromResponseBody<T>
thenGetBody(com.fasterxml.jackson.core.type.TypeReference<T> tRef)
Creates a step that returns deserialized content of body of the received response.<T> GetObjectFromResponseBody<T>
thenGetBody(Class<T> tClass)
Creates a step that returns deserialized content of body of the received response.<T> GetObjectFromResponseBody<T>
thenGetBody(DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<T> tRef)
Creates a step that returns deserialized content of body of the received response.<T> GetObjectFromResponseBody<T>
thenGetBody(DataTransformer transformer, Class<T> tClass)
Creates a step that returns deserialized content of body of the received response.<T,R,S extends Iterable<T>>
GetListFromResponse<T,S>thenGetList(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,S> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get anIterable
from deserialized response content - then returns items of the iterable (all items or ones that match defined criteria)<T,S extends Iterable<T>>
GetListFromResponse<T,S>thenGetList(String description, com.fasterxml.jackson.core.type.TypeReference<S> tRef)
Creates a step that: - deserializes content of body of the received response toIterable
- then returns items of the iterable (all items or ones that match defined criteria)<T,R,S extends Iterable<T>>
GetListFromResponse<T,S>thenGetList(String description, Class<R> tClass, Function<R,S> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get anIterable
from deserialized response content - then returns items of the iterable (all items or ones that match defined criteria)<T,S extends Iterable<T>>
GetListFromResponse<T,S>thenGetList(String description, Class<S> tClass)
Creates a step that: - deserializes content of body of the received response toIterable
- then returns items of the iterable (all items or ones that match defined criteria)<T,R,S extends Iterable<T>>
GetListFromResponse<T,S>thenGetList(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,S> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get anIterable
from deserialized response content - then returns items of the iterable (all items or ones that match defined criteria)<T,S extends Iterable<T>>
GetListFromResponse<T,S>thenGetList(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<S> tRef)
Creates a step that: - deserializes content of body of the received response toIterable
- then returns items of the iterable (all items or ones that match defined criteria)<T,R,S extends Iterable<T>>
GetListFromResponse<T,S>thenGetList(String description, DataTransformer transformer, Class<R> tClass, Function<R,S> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get anIterable
from deserialized response content - then returns items of the iterable (all items or ones that match defined criteria)<T,S extends Iterable<T>>
GetListFromResponse<T,S>thenGetList(String description, DataTransformer transformer, Class<S> tClass)
Creates a step that: - deserializes content of body of the received response toIterable
- then returns items of the iterable (all items or ones that match defined criteria)GetObjectFromResponseBody<String>
thenGetStringContent()
Creates a step that returns raw string content of body of the received response.<T,R>
GetObjectFromResponseBody<T>thenGetValue(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T> howToGet)
Creates a step that deserializes content of body of the received response and then return value taken from / calculated by deserialized content.<T,R>
GetObjectFromResponseBody<T>thenGetValue(String description, Class<R> tClass, Function<R,T> howToGet)
Creates a step that deserializes content of body of the received response and then return value taken from / calculated by deserialized content.<T,R>
GetObjectFromResponseBody<T>thenGetValue(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T> howToGet)
Creates a step that deserializes content of body of the received response and then return value taken from / calculated by deserialized content.<T,R>
GetObjectFromResponseBody<T>thenGetValue(String description, DataTransformer transformer, Class<R> tClass, Function<R,T> howToGet)
Creates a step that deserializes content of body of the received response and then return value taken from / calculated by deserialized content.<T,R>
GetObjectFromResponseBodyArray<T>thenGetValueFromArray(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T[]> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get an array from deserialized response content - then returns item of the array (the first found or one that matches defined criteria)<T> GetObjectFromResponseBodyArray<T>
thenGetValueFromArray(String description, com.fasterxml.jackson.core.type.TypeReference<T[]> tRef)
Creates a step that: - deserializes content of body of the received response to array - then returns item of the array (the first found or one that matches defined criteria)<T,R>
GetObjectFromResponseBodyArray<T>thenGetValueFromArray(String description, Class<R> tClass, Function<R,T[]> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get an array from deserialized response content - then returns item of the array (the first found or one that matches defined criteria)<T> GetObjectFromResponseBodyArray<T>
thenGetValueFromArray(String description, Class<T[]> tClass)
Creates a step that: - deserializes content of body of the received response to array - then returns item of the array (the first found or one that matches defined criteria)<T,R>
GetObjectFromResponseBodyArray<T>thenGetValueFromArray(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T[]> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get an array from deserialized response content - then returns item of the array (the first found or one that matches defined criteria)<T> GetObjectFromResponseBodyArray<T>
thenGetValueFromArray(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<T[]> tRef)
Creates a step that: - deserializes content of body of the received response to array - then returns item of the array (the first found or one that matches defined criteria)<T,R>
GetObjectFromResponseBodyArray<T>thenGetValueFromArray(String description, DataTransformer transformer, Class<R> tClass, Function<R,T[]> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get an array from deserialized response content - then returns item of the array (the first found or one that matches defined criteria)<T> GetObjectFromResponseBodyArray<T>
thenGetValueFromArray(String description, DataTransformer transformer, Class<T[]> tClass)
Creates a step that: - deserializes content of body of the received response to array - then returns item of the array (the first found or one that matches defined criteria)<T,R,S extends Iterable<T>>
GetObjectFromResponseBodyIterable<T>thenGetValueFromIterable(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,S> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get anIterable
from deserialized response content - then returns item of the iterable (the first found or one that matches defined criteria)<T,S extends Iterable<T>>
GetObjectFromResponseBodyIterable<T>thenGetValueFromIterable(String description, com.fasterxml.jackson.core.type.TypeReference<S> tRef)
Creates a step that: - deserializes content of body of the received response toIterable
- then returns item of the iterable (the first found or one that matches defined criteria)<T,R,S extends Iterable<T>>
GetObjectFromResponseBodyIterable<T>thenGetValueFromIterable(String description, Class<R> tClass, Function<R,S> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get anIterable
from deserialized response content - then returns item of the iterable (the first found or one that matches defined criteria)<T,S extends Iterable<T>>
GetObjectFromResponseBodyIterable<T>thenGetValueFromIterable(String description, Class<S> tClass)
Creates a step that: - deserializes content of body of the received response toIterable
- then returns item of the iterable (the first found or one that matches defined criteria)<T,R,S extends Iterable<T>>
GetObjectFromResponseBodyIterable<T>thenGetValueFromIterable(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,S> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get anIterable
from deserialized response content - then returns item of the iterable (the first found or one that matches defined criteria)<T,S extends Iterable<T>>
GetObjectFromResponseBodyIterable<T>thenGetValueFromIterable(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<S> tRef)
Creates a step that: - deserializes content of body of the received response toIterable
- then returns item of the iterable (the first found or one that matches defined criteria)<T,R,S extends Iterable<T>>
GetObjectFromResponseBodyIterable<T>thenGetValueFromIterable(String description, DataTransformer transformer, Class<R> tClass, Function<R,S> howToGet)
Creates a step that: - deserializes content of body of the received response - then tries to get anIterable
from deserialized response content - then returns item of the iterable (the first found or one that matches defined criteria)<T,S extends Iterable<T>>
GetObjectFromResponseBodyIterable<T>thenGetValueFromIterable(String description, DataTransformer transformer, Class<S> tClass)
Creates a step that: - deserializes content of body of the received response toIterable
- then returns item of the iterable (the first found or one that matches defined criteria)-
Methods inherited from class ru.tinkoff.qa.neptune.core.api.steps.SequentialGetStepSupplier
addIgnored, addIgnored, eraseTimeOut, get, getCriteria, getDescription, getEndFunction, getFrom, getParameters, makeACopy, onStart, pollingInterval, preparePreFunction, setDescription, throwOnNoResult, timeOut, toString, turnReportingOff
-
-
-
-
Method Detail
-
response
public static GetMockMvcResponseResultSupplier response(org.springframework.test.web.servlet.RequestBuilder builder)
Creates a step that gets a response.- Parameters:
builder
- is a request specification- Returns:
- an instance of GetMockMvcResponseResultSupplier
-
response
public static GetMockMvcResponseResultSupplier response(org.springframework.test.web.servlet.MockMvc mockMvc, org.springframework.test.web.servlet.RequestBuilder builder)
Creates a step that gets a response.- Parameters:
mockMvc
- explicitly defined instance ofMockMvc
builder
- is a request specification- Returns:
- an instance of GetMockMvcResponseResultSupplier
-
expectForward
public GetMockMvcResponseResultSupplier expectForward(String expectedUrl)
Asserts the request was forwarded to the given URL.
-
expectForwardTemplate
public GetMockMvcResponseResultSupplier expectForwardTemplate(String urlTemplate, Object... uriVars)
Asserts the request was forwarded to the given URL template.
-
expectForwardPattern
public GetMockMvcResponseResultSupplier expectForwardPattern(String urlPattern)
Asserts the request was forwarded to the given URL.
-
expectRedirect
public GetMockMvcResponseResultSupplier expectRedirect(String expectedUrl)
Asserts the request was redirected to the given URL.
-
expectRedirectTemplate
public GetMockMvcResponseResultSupplier expectRedirectTemplate(String urlTemplate, Object... uriVars)
Asserts the request was redirected to the given URL template.
-
expectRedirectPattern
public GetMockMvcResponseResultSupplier expectRedirectPattern(String urlPattern)
Asserts the request was redirected to the given URL.
-
expectJsonPath
public GetMockMvcResponseResultSupplier expectJsonPath(String expression, Function<org.springframework.test.web.servlet.result.JsonPathResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher, Object... jsonPathArgs)
Evaluate the JSON path expression against the response and assert the result in fluent way- Parameters:
expression
- the JSON path expression, optionally parameterized with argumentscreateMatcher
- the function what describes the assertion Example:jsonMatchers -> jsonMatchers.value(value)
jsonPathArgs
- arguments to parameterize the JSON path expression with- Returns:
- self-reference
-
expectJsonPath
public GetMockMvcResponseResultSupplier expectJsonPath(String expression, Object... jsonPathArgs)
Evaluate the JSON path expression against the response content and assert that a non-null value, possibly an empty array or map, exists at the given path. If the JSON path expression is not definite, this method asserts that the value at the given path is not empty.
-
expectJsonPathValue
public GetMockMvcResponseResultSupplier expectJsonPathValue(String expression, Object value, Object... jsonPathArgs)
Evaluate the JSON path expression against the response content and assert that the result is equal to the supplied value.
-
expectJsonPathValue
public <T> GetMockMvcResponseResultSupplier expectJsonPathValue(String expression, org.hamcrest.Matcher<? super T> matcher, Object... jsonPathArgs)
Evaluate the JSON path expression against the response content and assert the resulting value with the given HamcrestMatcher
-
expectJsonPath
public <T> GetMockMvcResponseResultSupplier expectJsonPath(String expression, org.hamcrest.Matcher<? super T> matcher, Class<T> targetType, Object... jsonPathArgs)
Evaluate the JSON path expression against the response content and assert the resulting value is read into value of expected type and suits the given matcher.This can be useful for matching numbers reliably — for example, to coerce an integer into a double.
-
expectXPath
public GetMockMvcResponseResultSupplier expectXPath(String expression, Map<String,String> namespaces, Function<org.springframework.test.web.servlet.result.XpathResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher, Object... xPathArgs)
Evaluate the xPath expression against the response and assert the result in fluent way- Parameters:
expression
- the XPath expression, optionally parameterized with argumentsnamespaces
- the namespaces referenced in the XPath expressioncreateMatcher
- the function what describes the assertion Example:xpathMatchers -> xpathMatchers.string("someString")
xPathArgs
- arguments to parameterize the XPath expression with- Returns:
- self-reference
-
expectXPath
public GetMockMvcResponseResultSupplier expectXPath(String expression, Function<org.springframework.test.web.servlet.result.XpathResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher, Object... xPathArgs)
Evaluate the xPath expression against the response and assert the result in fluent way- Parameters:
expression
- the XPath expression, optionally parameterized with argumentscreateMatcher
- the function what describes the assertion Example:xpathMatchers -> xpathMatchers.string("someString")
xPathArgs
- arguments to parameterize the XPath expression with- Returns:
- self-reference
-
expectXPath
public GetMockMvcResponseResultSupplier expectXPath(String expression, Map<String,String> namespaces, Object... xPathArgs)
Evaluate the XPath and assert that content exists.
-
expectXPath
public GetMockMvcResponseResultSupplier expectXPath(String expression, Object... xPathArgs)
Evaluate the XPath and assert that content exists.
-
expectXPathNode
public GetMockMvcResponseResultSupplier expectXPathNode(String expression, Map<String,String> namespaces, org.hamcrest.Matcher<? super Node> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNode
content found with the given HamcrestMatcher
.
-
expectXPathNode
public GetMockMvcResponseResultSupplier expectXPathNode(String expression, org.hamcrest.Matcher<? super Node> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNode
content found with the given HamcrestMatcher
.
-
expectXPathNodeList
public GetMockMvcResponseResultSupplier expectXPathNodeList(String expression, Map<String,String> namespaces, org.hamcrest.Matcher<? super NodeList> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNodeList
content found with the given HamcrestMatcher
.
-
expectXPathNodeList
public GetMockMvcResponseResultSupplier expectXPathNodeList(String expression, org.hamcrest.Matcher<? super NodeList> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNodeList
content found with the given HamcrestMatcher
.
-
expectXPathNodeCount
public GetMockMvcResponseResultSupplier expectXPathNodeCount(String expression, Map<String,String> namespaces, int count, Object... xPathArgs)
Evaluate the XPath and assert the number of nodes found.
-
expectXPathNodeCount
public GetMockMvcResponseResultSupplier expectXPathNodeCount(String expression, int count, Object... xPathArgs)
Evaluate the XPath and assert the number of nodes found.
-
expectStatus
public GetMockMvcResponseResultSupplier expectStatus(Function<org.springframework.test.web.servlet.result.StatusResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts the response status in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:statusMatchers -> statusMatchers.is2xxSuccessful()
- Returns:
- self-reference
-
expectStatus
public GetMockMvcResponseResultSupplier expectStatus(int expected)
Assert the response status code is equal to an integer value
-
expectStatus
public GetMockMvcResponseResultSupplier expectStatus(org.hamcrest.Matcher<? super Integer> matcher)
Assert the response status code with the given HamcrestMatcher
-
expectStatusIs1xxInformational
public GetMockMvcResponseResultSupplier expectStatusIs1xxInformational()
Assert the response status code is in the 1xx range.
-
expectStatusIs2xxSuccessful
public GetMockMvcResponseResultSupplier expectStatusIs2xxSuccessful()
Assert the response status code is in the 2xx range.
-
expectStatusIs3xxRedirection
public GetMockMvcResponseResultSupplier expectStatusIs3xxRedirection()
Assert the response status code is in the 3xx range.
-
expectStatusIs4xxClientError
public GetMockMvcResponseResultSupplier expectStatusIs4xxClientError()
Assert the response status code is in the 4xx range.
-
expectStatusIs5xxServerError
public GetMockMvcResponseResultSupplier expectStatusIs5xxServerError()
Assert the response status code is in the 5xx range.
-
expectStatusReason
public GetMockMvcResponseResultSupplier expectStatusReason(String reason)
Assert the Servlet response error message.
-
expectStatusReason
public GetMockMvcResponseResultSupplier expectStatusReason(org.hamcrest.Matcher<? super String> matcher)
Assert the Servlet response error message with the given HamcrestMatcher
.
-
expectRequest
public GetMockMvcResponseResultSupplier expectRequest(Function<org.springframework.test.web.servlet.result.RequestResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts the request in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:requestMatchers -> requestMatchers.asyncStarted()
- Returns:
- self-reference
-
expectView
public GetMockMvcResponseResultSupplier expectView(Function<org.springframework.test.web.servlet.result.ViewResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts view in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:viewMatchers -> viewMatchers.name(name)
- Returns:
- self-reference
-
expectViewName
public GetMockMvcResponseResultSupplier expectViewName(String name)
Assert the selected view name.
-
expectViewName
public GetMockMvcResponseResultSupplier expectViewName(org.hamcrest.Matcher<? super String> nameMatcher)
Assert the selected view name with the given HamcrestMatcher
.
-
expectModel
public GetMockMvcResponseResultSupplier expectModel(Function<org.springframework.test.web.servlet.result.ModelResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts model in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:modelMatchers -> modelMatchers.attribute(attribute, value)
- Returns:
- self-reference
-
expectModelAttribute
public GetMockMvcResponseResultSupplier expectModelAttribute(String attribute, Object value)
Assert a model attribute value.
-
expectModelAttribute
public <T> GetMockMvcResponseResultSupplier expectModelAttribute(String attribute, org.hamcrest.Matcher<? super T> matcher)
Assert a model attribute value with the given HamcrestMatcher
.
-
expectModelAttributes
public GetMockMvcResponseResultSupplier expectModelAttributes(String... attributes)
Assert the given model attributes exist.
-
expectFlash
public GetMockMvcResponseResultSupplier expectFlash(Function<org.springframework.test.web.servlet.result.FlashAttributeResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts flash attributes in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:flashMatchers -> flashMatchers.attribute(attribute, value)
- Returns:
- self-reference
-
expectFlashAttribute
public GetMockMvcResponseResultSupplier expectFlashAttribute(String attribute, Object value)
Assert a flash attribute's value.
-
expectFlashAttribute
public <T> GetMockMvcResponseResultSupplier expectFlashAttribute(String attribute, org.hamcrest.Matcher<? super T> matcherValue)
Assert a flash attribute's value with the given HamcrestMatcher
.
-
expectFlashAttributes
public GetMockMvcResponseResultSupplier expectFlashAttributes(String... names)
Assert the existence of the given flash attributes.
-
expectFlashAttributeCount
public GetMockMvcResponseResultSupplier expectFlashAttributeCount(int count)
Assert the number of flash attributes.
-
expectHandler
public GetMockMvcResponseResultSupplier expectHandler(Function<org.springframework.test.web.servlet.result.HandlerResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts handlers in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:handlersMatchers -> handlersMatchers.handlerType(handlerType)
- Returns:
- self-reference
-
expectHandlerType
public <T> GetMockMvcResponseResultSupplier expectHandlerType(Class<T> handlerType)
Assert the type of the handler that processed the request.
-
expectHandlerMethod
public GetMockMvcResponseResultSupplier expectHandlerMethod(Method method)
Assert the controller method used to process the request.
-
expectHandlerMethod
public GetMockMvcResponseResultSupplier expectHandlerMethod(String methodName)
Assert the name of the controller method used to process the request.
-
expectHandlerMethod
public GetMockMvcResponseResultSupplier expectHandlerMethod(org.hamcrest.Matcher<? super String> methodNameMatcher)
Assert the name of the controller method used to process the request using the given HamcrestMatcher
.
-
expectHandlerCall
public <T,R> GetMockMvcResponseResultSupplier expectHandlerCall(Class<T> handlerType, Function<T,R> getCallResult)
Assert the controller method used to process the request.The expected method is specified through a "mock" controller method invocation similar to
MvcUriComponentsBuilder.fromMethodCall(Object)
.- Type Parameters:
T
- is a type of expected handler- Parameters:
handlerType
- is a type of expected handlergetCallResult
- describes expected invocation of a method of the handler. The method which is expected to be invoked should return some value
-
expectHeader
public GetMockMvcResponseResultSupplier expectHeader(Function<org.springframework.test.web.servlet.result.HeaderResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts header in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:headerMatchers -> headerMatchers.string(headerName, value)
- Returns:
- self-reference
-
expectHeader
public GetMockMvcResponseResultSupplier expectHeader(String headerName)
Assert that the named response header exists.
-
expectHeaderValue
public GetMockMvcResponseResultSupplier expectHeaderValue(String headerName, String value)
Assert the primary value of the response header as a String value.
-
expectHeaderValue
public GetMockMvcResponseResultSupplier expectHeaderValue(String headerName, org.hamcrest.Matcher<? super String> valueMatcher)
Assert the primary value of the response header with the given Hamcrest StringMatcher
.
-
expectHeaderValues
public GetMockMvcResponseResultSupplier expectHeaderValues(String headerName, String... values)
Assert the values of the response header as String values.
-
expectHeaderValues
public GetMockMvcResponseResultSupplier expectHeaderValues(String headerName, org.hamcrest.Matcher<? super Iterable<String>> valuesMatcher)
Assert the values of the response header with the given Hamcrest IterableMatcher
.
-
expectContent
public GetMockMvcResponseResultSupplier expectContent(Function<org.springframework.test.web.servlet.result.ContentResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts content in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:contentMatchers -> contentMatchers.string(expectedString)
- Returns:
- self-reference
-
expectContentType
public GetMockMvcResponseResultSupplier expectContentType(String contentType)
Assert the ServletResponse content type. The given content type must fully match including type, sub-type, and parameters
-
expectContentType
public GetMockMvcResponseResultSupplier expectContentType(org.springframework.http.MediaType contentType)
Assert the ServletResponse content type after parsing it as a MediaType. The given content type must fully match including type, sub-type, and parameters.
-
expectContentEncoding
public GetMockMvcResponseResultSupplier expectContentEncoding(String encoding)
Assert the character encoding in the ServletResponse.
-
expectContentEncoding
public GetMockMvcResponseResultSupplier expectContentEncoding(Charset characterEncoding)
Assert the character encoding in the ServletResponse.
-
expectContentBytes
public GetMockMvcResponseResultSupplier expectContentBytes(byte[] expectedBytes)
Assert the response body content as a byte array.
-
expectContent
public GetMockMvcResponseResultSupplier expectContent(String expectedString)
Assert the response body content as a String.
-
expectContent
public GetMockMvcResponseResultSupplier expectContent(org.hamcrest.Matcher<? super String> stringMatcher)
Assert the response body content with a HamcrestMatcher
.
-
expectJsonContent
public GetMockMvcResponseResultSupplier expectJsonContent(String expectedJsonContent)
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e. they contain the same attribute-value pairs regardless of formatting with a lenient checking (extensible, and non-strict array ordering).
-
expectJsonContent
public GetMockMvcResponseResultSupplier expectJsonContent(String expectedJsonContent, boolean strict)
Parse the response content and the given string as JSON and assert the two are "similar" - i.e. they contain the same attribute-value pairs regardless of formatting.Can compare in two modes, depending on
strict
parameter value:true
: strict checking. Not extensible, and strict array ordering.false
: lenient checking. Extensible, and non-strict array ordering.
Use of this matcher requires the JSONassert library.
-
expectXmlContent
public GetMockMvcResponseResultSupplier expectXmlContent(String xmlContent)
Parse the response content and the given string as XML and assert the two are "similar" - i.e. they contain the same elements and attributes regardless of order.Use of this matcher requires the XMLUnit library.
-
expectContent
public <T> GetMockMvcResponseResultSupplier expectContent(T serialized, DataTransformer dataTransformer)
Assert the response body content as a String. It is expected that it is equal to serialized POJO/DTO/collection- Type Parameters:
T
- is a type of object to be serialized into string and compared with content- Parameters:
serialized
- is an object to be serialized into string and compared with contentdataTransformer
- performs serialization of the object
-
expectContent
public <T> GetMockMvcResponseResultSupplier expectContent(T serialized)
Assert the response body content as a String. It is expected that it is equal to serialized POJO/DTO/collection- Type Parameters:
T
- is a type of object to be serialized into string and compared with content- Parameters:
serialized
- is an object to be serialized into string and compared with content- See Also:
SpringMockMvcDefaultResponseBodyTransformer
,SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
-
expectCookie
public GetMockMvcResponseResultSupplier expectCookie(Function<org.springframework.test.web.servlet.result.CookieResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)
Asserts cookie in fluent way- Parameters:
createMatcher
- the function what describes the assertion Example:cookie -> cookie.value(name, value)
- Returns:
- self-reference
-
expectCookie
public GetMockMvcResponseResultSupplier expectCookie(String name)
Assert a cookie exists. The existence check is irrespective of whether max age is 0 (i.e. expired).
-
expectCookieValue
public GetMockMvcResponseResultSupplier expectCookieValue(String name, String value)
Assert a cookie value.
-
expectCookieValue
public GetMockMvcResponseResultSupplier expectCookieValue(String name, org.hamcrest.Matcher<? super String> valueMatcher)
Assert a cookie value with the given HamcrestMatcher
.
-
expectCookieMaxAge
public GetMockMvcResponseResultSupplier expectCookieMaxAge(String name, org.hamcrest.Matcher<? super Integer> matcher)
Assert a cookie's maxAge with a HamcrestMatcher
.
-
expectCookieMaxAge
public GetMockMvcResponseResultSupplier expectCookieMaxAge(String name, int maxAge)
Assert a cookie's maxAge.
-
expectCookiePath
public GetMockMvcResponseResultSupplier expectCookiePath(String name, org.hamcrest.Matcher<? super String> matcher)
Assert a cookie's path with a HamcrestMatcher
.
-
expectCookiePath
public GetMockMvcResponseResultSupplier expectCookiePath(String name, String path)
Assert a cookie's path.
-
expectCookieDomain
public GetMockMvcResponseResultSupplier expectCookieDomain(String name, org.hamcrest.Matcher<? super String> matcher)
Assert a cookie's domain with a HamcrestMatcher
.
-
expectCookieDomain
public GetMockMvcResponseResultSupplier expectCookieDomain(String name, String domain)
Assert a cookie's domain.
-
expectCookieComment
public GetMockMvcResponseResultSupplier expectCookieComment(String name, org.hamcrest.Matcher<? super String> matcher)
Assert a cookie's comment with a HamcrestMatcher
.
-
expectCookieComment
public GetMockMvcResponseResultSupplier expectCookieComment(String name, String comment)
Assert a cookie's comment.
-
expectCookieVersion
public GetMockMvcResponseResultSupplier expectCookieVersion(String name, org.hamcrest.Matcher<? super Integer> matcher)
Assert a cookie's version with a HamcrestMatcher
.
-
expectCookieVersion
public GetMockMvcResponseResultSupplier expectCookieVersion(String name, int version)
Assert a cookie's version.
-
expectCookieSecure
public GetMockMvcResponseResultSupplier expectCookieSecure(String name, boolean secure)
Assert whether the cookie must be sent over a secure protocol or not.
-
expectCookieHttpOnly
public GetMockMvcResponseResultSupplier expectCookieHttpOnly(String name, boolean httpOnly)
Assert whether the cookie must be HTTP only.
-
expectNoResolvedException
public GetMockMvcResponseResultSupplier expectNoResolvedException()
Asserts that there is no exception raised by a handler and successfully resolved through aHandlerExceptionResolver
.
-
expectResolvedException
public GetMockMvcResponseResultSupplier expectResolvedException()
Asserts that there is an exception raised by a handler and successfully resolved through aHandlerExceptionResolver
-
expectResolvedException
@SafeVarargs public final GetMockMvcResponseResultSupplier expectResolvedException(org.hamcrest.Matcher<? super Throwable>... matchers)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolver
with a HamcrestMatcher
-
expectResolvedException
public <T extends Exception> GetMockMvcResponseResultSupplier expectResolvedException(Class<T> exceptionClass)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolver
is an object of the defined class (not of any subclass)
-
expectResolvedException
public <T extends Exception> GetMockMvcResponseResultSupplier expectResolvedException(Class<T> exceptionClass, String message)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolver
is an object of the defined class (not of any subclass) and has defined message
-
expectResolvedException
@SafeVarargs public final <T extends Exception> GetMockMvcResponseResultSupplier expectResolvedException(Class<T> exceptionClass, org.hamcrest.Matcher<? super String>... messageMatchers)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolver
is an object of the defined class (not of any subclass) and has a message that suits defined HamcrestMatcher
-
onSuccess
protected void onSuccess(org.springframework.mock.web.MockHttpServletResponse mockHttpServletResponse)
Description copied from class:SequentialGetStepSupplier
Some additional action if the step is successful- Overrides:
onSuccess
in classSequentialGetStepSupplier<MockMvcContext,org.springframework.mock.web.MockHttpServletResponse,MockMvcContext,org.springframework.mock.web.MockHttpServletResponse,GetMockMvcResponseResultSupplier>
- Parameters:
mockHttpServletResponse
- is a result value
-
onFailure
protected void onFailure(MockMvcContext mockMvcContext, Throwable throwable)
Description copied from class:SequentialGetStepSupplier
Some additional action if the step is failed- Overrides:
onFailure
in classSequentialGetStepSupplier<MockMvcContext,org.springframework.mock.web.MockHttpServletResponse,MockMvcContext,org.springframework.mock.web.MockHttpServletResponse,GetMockMvcResponseResultSupplier>
- Parameters:
mockMvcContext
- is a mediator value is used to get the required resultthrowable
- is a thrown exception/error
-
additionalParameters
protected Map<String,String> additionalParameters()
Description copied from class:SequentialGetStepSupplier
Returns additional parameters calculated during step execution- Overrides:
additionalParameters
in classSequentialGetStepSupplier<MockMvcContext,org.springframework.mock.web.MockHttpServletResponse,MockMvcContext,org.springframework.mock.web.MockHttpServletResponse,GetMockMvcResponseResultSupplier>
- Returns:
- additional parameters calculated during step execution
-
thenGetStringContent
public GetObjectFromResponseBody<String> thenGetStringContent()
Creates a step that returns raw string content of body of the received response.- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetBody
public <T> GetObjectFromResponseBody<T> thenGetBody(DataTransformer transformer, Class<T> tClass)
Creates a step that returns deserialized content of body of the received response.- Type Parameters:
T
- is a type of deserialized body- Parameters:
transformer
- performs deserializationtClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetBody
public <T> GetObjectFromResponseBody<T> thenGetBody(DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<T> tRef)
Creates a step that returns deserialized content of body of the received response.- Type Parameters:
T
- is a type of deserialized body- Parameters:
transformer
- performs deserializationtRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetBody
public <T> GetObjectFromResponseBody<T> thenGetBody(Class<T> tClass)
Creates a step that returns deserialized content of body of the received response. Value ofSpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of deserialized body- Parameters:
tClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetBody
public <T> GetObjectFromResponseBody<T> thenGetBody(com.fasterxml.jackson.core.type.TypeReference<T> tRef)
Creates a step that returns deserialized content of body of the received response. Value ofSpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of deserialized body- Parameters:
tRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetValue
public <T,R> GetObjectFromResponseBody<T> thenGetValue(String description, DataTransformer transformer, Class<R> tClass, Function<R,T> howToGet)
Creates a step that deserializes content of body of the received response and then return value taken from / calculated by deserialized content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted value- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetValue
public <T,R> GetObjectFromResponseBody<T> thenGetValue(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T> howToGet)
Creates a step that deserializes content of body of the received response and then return value taken from / calculated by deserialized content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted value- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetValue
public <T,R> GetObjectFromResponseBody<T> thenGetValue(String description, Class<R> tClass, Function<R,T> howToGet)
Creates a step that deserializes content of body of the received response and then return value taken from / calculated by deserialized content. Value ofSpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted value- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetValue
public <T,R> GetObjectFromResponseBody<T> thenGetValue(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T> howToGet)
Creates a step that deserializes content of body of the received response and then return value taken from / calculated by deserialized content. Value ofSpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted value- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetObjectFromResponseBody
-
thenGetValueFromArray
public <T,R> GetObjectFromResponseBodyArray<T> thenGetValueFromArray(String description, DataTransformer transformer, Class<R> tClass, Function<R,T[]> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an array from deserialized response content
- - then returns item of the array (the first found or one that matches defined criteria)
- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted value- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserializationhowToGet
- describes how to get an array- Returns:
- an instance of
GetObjectFromResponseBodyArray
-
thenGetValueFromArray
public <T,R> GetObjectFromResponseBodyArray<T> thenGetValueFromArray(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T[]> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an array from deserialized response content
- - then returns item of the array (the first found or one that matches defined criteria)
- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted value- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserializationhowToGet
- describes how to get an array- Returns:
- an instance of
GetObjectFromResponseBodyArray
-
thenGetValueFromArray
public <T,R> GetObjectFromResponseBodyArray<T> thenGetValueFromArray(String description, Class<R> tClass, Function<R,T[]> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an array from deserialized response content
- - then returns item of the array (the first found or one that matches defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted value- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserializationhowToGet
- describes how to get an array- Returns:
- an instance of
GetObjectFromResponseBodyArray
-
thenGetValueFromArray
public <T,R> GetObjectFromResponseBodyArray<T> thenGetValueFromArray(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T[]> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an array from deserialized response content
- - then returns item of the array (the first found or one that matches defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted value- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserializationhowToGet
- describes how to get an array- Returns:
- an instance of
GetObjectFromResponseBodyArray
-
thenGetValueFromArray
public <T> GetObjectFromResponseBodyArray<T> thenGetValueFromArray(String description, DataTransformer transformer, Class<T[]> tClass)
Creates a step that:- - deserializes content of body of the received response to array
- - then returns item of the array (the first found or one that matches defined criteria)
- Type Parameters:
T
- is a type of resulted value- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBodyArray
-
thenGetValueFromArray
public <T> GetObjectFromResponseBodyArray<T> thenGetValueFromArray(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<T[]> tRef)
Creates a step that:- - deserializes content of body of the received response to array
- - then returns item of the array (the first found or one that matches defined criteria)
- Type Parameters:
T
- is a type of resulted value- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBodyArray
-
thenGetValueFromArray
public <T> GetObjectFromResponseBodyArray<T> thenGetValueFromArray(String description, Class<T[]> tClass)
Creates a step that:- - deserializes content of body of the received response to array
- - then returns item of the array (the first found or one that matches defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of resulted value- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBodyArray
-
thenGetValueFromArray
public <T> GetObjectFromResponseBodyArray<T> thenGetValueFromArray(String description, com.fasterxml.jackson.core.type.TypeReference<T[]> tRef)
Creates a step that:- - deserializes content of body of the received response to array
- - then returns item of the array (the first found or one that matches defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of resulted value- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBodyArray
-
thenGetValueFromIterable
public <T,R,S extends Iterable<T>> GetObjectFromResponseBodyIterable<T> thenGetValueFromIterable(String description, DataTransformer transformer, Class<R> tClass, Function<R,S> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an
Iterable
from deserialized response content - - then returns item of the iterable (the first found or one that matches defined criteria)
- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted valueS
- is a type of iterable- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetObjectFromResponseBodyIterable
-
thenGetValueFromIterable
public <T,R,S extends Iterable<T>> GetObjectFromResponseBodyIterable<T> thenGetValueFromIterable(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,S> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an
Iterable
from deserialized response content - - then returns item of the iterable (the first found or one that matches defined criteria)
- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted valueS
- is a type of iterable- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetObjectFromResponseBodyIterable
-
thenGetValueFromIterable
public <T,R,S extends Iterable<T>> GetObjectFromResponseBodyIterable<T> thenGetValueFromIterable(String description, Class<R> tClass, Function<R,S> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an
Iterable
from deserialized response content - - then returns item of the iterable (the first found or one that matches defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted valueS
- is a type of iterable- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetObjectFromResponseBodyIterable
-
thenGetValueFromIterable
public <T,R,S extends Iterable<T>> GetObjectFromResponseBodyIterable<T> thenGetValueFromIterable(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,S> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an
Iterable
from deserialized response content - - then returns item of the iterable (the first found or one that matches defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of resulted valueS
- is a type of iterable- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetObjectFromResponseBodyIterable
-
thenGetValueFromIterable
public <T,S extends Iterable<T>> GetObjectFromResponseBodyIterable<T> thenGetValueFromIterable(String description, DataTransformer transformer, Class<S> tClass)
Creates a step that:- - deserializes content of body of the received response to
Iterable
- - then returns item of the iterable (the first found or one that matches defined criteria)
- Type Parameters:
T
- is a type of resulted valueS
- is a type of iterable- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBodyIterable
- - deserializes content of body of the received response to
-
thenGetValueFromIterable
public <T,S extends Iterable<T>> GetObjectFromResponseBodyIterable<T> thenGetValueFromIterable(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<S> tRef)
Creates a step that:- - deserializes content of body of the received response to
Iterable
- - then returns item of the iterable (the first found or one that matches defined criteria)
- Type Parameters:
T
- is a type of resulted valueS
- is a type of iterable- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBodyIterable
- - deserializes content of body of the received response to
-
thenGetValueFromIterable
public <T,S extends Iterable<T>> GetObjectFromResponseBodyIterable<T> thenGetValueFromIterable(String description, Class<S> tClass)
Creates a step that:- - deserializes content of body of the received response to
Iterable
- - then returns item of the iterable (the first found or one that matches defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of resulted valueS
- is a type of iterable- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBodyIterable
- - deserializes content of body of the received response to
-
thenGetValueFromIterable
public <T,S extends Iterable<T>> GetObjectFromResponseBodyIterable<T> thenGetValueFromIterable(String description, com.fasterxml.jackson.core.type.TypeReference<S> tRef)
Creates a step that:- - deserializes content of body of the received response to
Iterable
- - then returns item of the iterable (the first found or one that matches defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of resulted valueS
- is a type of iterable- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetObjectFromResponseBodyIterable
- - deserializes content of body of the received response to
-
thenGetList
public <T,R,S extends Iterable<T>> GetListFromResponse<T,S> thenGetList(String description, DataTransformer transformer, Class<R> tClass, Function<R,S> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an
Iterable
from deserialized response content - - then returns items of the iterable (all items or ones that match defined criteria)
- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of item from resulted iterableS
- is a type of resulted iterable- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetListFromResponse
-
thenGetList
public <T,R,S extends Iterable<T>> GetListFromResponse<T,S> thenGetList(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,S> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an
Iterable
from deserialized response content - - then returns items of the iterable (all items or ones that match defined criteria)
- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of item from resulted iterableS
- is a type of resulted iterable- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetListFromResponse
-
thenGetList
public <T,R,S extends Iterable<T>> GetListFromResponse<T,S> thenGetList(String description, Class<R> tClass, Function<R,S> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an
Iterable
from deserialized response content - - then returns items of the iterable (all items or ones that match defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of item from resulted iterableS
- is a type of resulted iterable- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetListFromResponse
-
thenGetList
public <T,R,S extends Iterable<T>> GetListFromResponse<T,S> thenGetList(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,S> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an
Iterable
from deserialized response content - - then returns items of the iterable (all items or ones that match defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of item from resulted iterableS
- is a type of resulted iterable- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserializationhowToGet
- describes how to get desired value- Returns:
- an instance of
GetListFromResponse
-
thenGetList
public <T,S extends Iterable<T>> GetListFromResponse<T,S> thenGetList(String description, DataTransformer transformer, Class<S> tClass)
Creates a step that:- - deserializes content of body of the received response to
Iterable
- - then returns items of the iterable (all items or ones that match defined criteria)
- Type Parameters:
T
- is a type of item from resulted iterableS
- is a type of resulted iterable- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetListFromResponse
- - deserializes content of body of the received response to
-
thenGetList
public <T,S extends Iterable<T>> GetListFromResponse<T,S> thenGetList(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<S> tRef)
Creates a step that:- - deserializes content of body of the received response to
Iterable
- - then returns items of the iterable (all items or ones that match defined criteria)
- Type Parameters:
T
- is a type of item from resulted iterableS
- is a type of resulted iterable- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetListFromResponse
- - deserializes content of body of the received response to
-
thenGetList
public <T,S extends Iterable<T>> GetListFromResponse<T,S> thenGetList(String description, Class<S> tClass)
Creates a step that:- - deserializes content of body of the received response to
Iterable
- - then returns items of the iterable (all items or ones that match defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of item from resulted iterableS
- is a type of resulted iterable- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetListFromResponse
- - deserializes content of body of the received response to
-
thenGetList
public <T,S extends Iterable<T>> GetListFromResponse<T,S> thenGetList(String description, com.fasterxml.jackson.core.type.TypeReference<S> tRef)
Creates a step that:- - deserializes content of body of the received response to
Iterable
- - then returns items of the iterable (all items or ones that match defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of item from resulted iterableS
- is a type of resulted iterable- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetListFromResponse
- - deserializes content of body of the received response to
-
thenGetArray
public <T,R> GetArrayFromResponse<T> thenGetArray(String description, DataTransformer transformer, Class<R> tClass, Function<R,T[]> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an array from deserialized response content
- - then returns items of the array (all items or ones that match defined criteria)
- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of item of resulted array- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserializationhowToGet
- describes how to get an array- Returns:
- an instance of
GetArrayFromResponse
-
thenGetArray
public <T,R> GetArrayFromResponse<T> thenGetArray(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T[]> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an array from deserialized response content
- - then returns items of the array (all items or ones that match defined criteria)
- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of item of resulted array- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserializationhowToGet
- describes how to get an array- Returns:
- an instance of
GetArrayFromResponse
-
thenGetArray
public <T,R> GetArrayFromResponse<T> thenGetArray(String description, Class<R> tClass, Function<R,T[]> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an array from deserialized response content
- - then returns items of the array (all items or ones that match defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of item of resulted array- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserializationhowToGet
- describes how to get an array- Returns:
- an instance of
GetArrayFromResponse
-
thenGetArray
public <T,R> GetArrayFromResponse<T> thenGetArray(String description, com.fasterxml.jackson.core.type.TypeReference<R> tRef, Function<R,T[]> howToGet)
Creates a step that:- - deserializes content of body of the received response
- - then tries to get an array from deserialized response content
- - then returns items of the array (all items or ones that match defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
R
- is a type of deserialized bodyT
- is a type of item of resulted array- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserializationhowToGet
- describes how to get an array- Returns:
- an instance of
GetArrayFromResponse
-
thenGetArray
public <T> GetArrayFromResponse<T> thenGetArray(String description, DataTransformer transformer, Class<T[]> tClass)
Creates a step that:- - deserializes content of body of the received response to array
- - then returns items of the array (all items or ones that match defined criteria)
- Type Parameters:
T
- is a type of item of resulted array- Parameters:
description
- is description of value to gettransformer
- performs deserializationtClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetArrayFromResponse
-
thenGetArray
public <T> GetArrayFromResponse<T> thenGetArray(String description, DataTransformer transformer, com.fasterxml.jackson.core.type.TypeReference<T[]> tRef)
Creates a step that:- - deserializes content of body of the received response to array
- - then returns items of the array (all items or ones that match defined criteria)
- Type Parameters:
T
- is a type of item of resulted array- Parameters:
description
- is description of value to gettransformer
- performs deserializationtRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetArrayFromResponse
-
thenGetArray
public <T> GetArrayFromResponse<T> thenGetArray(String description, Class<T[]> tClass)
Creates a step that:- - deserializes content of body of the received response to array
- - then returns items of the array (all items or ones that match defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of item of resulted array- Parameters:
description
- is description of value to gettClass
- is a class of result of performed deserialization- Returns:
- an instance of
GetArrayFromResponse
-
thenGetArray
public <T> GetArrayFromResponse<T> thenGetArray(String description, com.fasterxml.jackson.core.type.TypeReference<T[]> tRef)
Creates a step that:- - deserializes content of body of the received response to array
- - then returns items of the array (all items or ones that match defined criteria)
Value of
SpringMockMvcDefaultResponseBodyTransformer.SPRING_MOCK_MVC_DEFAULT_RESPONSE_BODY_TRANSFORMER
is used to deserialize string body content.- Type Parameters:
T
- is a type of item of resulted array- Parameters:
description
- is description of value to gettRef
- is a type of result of performed deserialization- Returns:
- an instance of
GetArrayFromResponse
-
-