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 executionGetMockMvcResponseResultSupplierexpectContent(String expectedString)Assert the response body content as a String.GetMockMvcResponseResultSupplierexpectContent(Function<org.springframework.test.web.servlet.result.ContentResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)Asserts content in fluent wayGetMockMvcResponseResultSupplierexpectContent(org.hamcrest.Matcher<? super String> stringMatcher)Assert the response body content with a HamcrestMatcher.<T> GetMockMvcResponseResultSupplierexpectContent(T serialized)Assert the response body content as a String.<T> GetMockMvcResponseResultSupplierexpectContent(T serialized, DataTransformer dataTransformer)Assert the response body content as a String.GetMockMvcResponseResultSupplierexpectContentBytes(byte[] expectedBytes)Assert the response body content as a byte array.GetMockMvcResponseResultSupplierexpectContentEncoding(String encoding)Assert the character encoding in the ServletResponse.GetMockMvcResponseResultSupplierexpectContentEncoding(Charset characterEncoding)Assert the character encoding in the ServletResponse.GetMockMvcResponseResultSupplierexpectContentType(String contentType)Assert the ServletResponse content type.GetMockMvcResponseResultSupplierexpectContentType(org.springframework.http.MediaType contentType)Assert the ServletResponse content type after parsing it as a MediaType.GetMockMvcResponseResultSupplierexpectCookie(String name)Assert a cookie exists.GetMockMvcResponseResultSupplierexpectCookie(Function<org.springframework.test.web.servlet.result.CookieResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)Asserts cookie in fluent wayGetMockMvcResponseResultSupplierexpectCookieComment(String name, String comment)Assert a cookie's comment.GetMockMvcResponseResultSupplierexpectCookieComment(String name, org.hamcrest.Matcher<? super String> matcher)Assert a cookie's comment with a HamcrestMatcher.GetMockMvcResponseResultSupplierexpectCookieDomain(String name, String domain)Assert a cookie's domain.GetMockMvcResponseResultSupplierexpectCookieDomain(String name, org.hamcrest.Matcher<? super String> matcher)Assert a cookie's domain with a HamcrestMatcher.GetMockMvcResponseResultSupplierexpectCookieHttpOnly(String name, boolean httpOnly)Assert whether the cookie must be HTTP only.GetMockMvcResponseResultSupplierexpectCookieMaxAge(String name, int maxAge)Assert a cookie's maxAge.GetMockMvcResponseResultSupplierexpectCookieMaxAge(String name, org.hamcrest.Matcher<? super Integer> matcher)Assert a cookie's maxAge with a HamcrestMatcher.GetMockMvcResponseResultSupplierexpectCookiePath(String name, String path)Assert a cookie's path.GetMockMvcResponseResultSupplierexpectCookiePath(String name, org.hamcrest.Matcher<? super String> matcher)Assert a cookie's path with a HamcrestMatcher.GetMockMvcResponseResultSupplierexpectCookieSecure(String name, boolean secure)Assert whether the cookie must be sent over a secure protocol or not.GetMockMvcResponseResultSupplierexpectCookieValue(String name, String value)Assert a cookie value.GetMockMvcResponseResultSupplierexpectCookieValue(String name, org.hamcrest.Matcher<? super String> valueMatcher)Assert a cookie value with the given HamcrestMatcher.GetMockMvcResponseResultSupplierexpectCookieVersion(String name, int version)Assert a cookie's version.GetMockMvcResponseResultSupplierexpectCookieVersion(String name, org.hamcrest.Matcher<? super Integer> matcher)Assert a cookie's version with a HamcrestMatcher.GetMockMvcResponseResultSupplierexpectFlash(Function<org.springframework.test.web.servlet.result.FlashAttributeResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)Asserts flash attributes in fluent wayGetMockMvcResponseResultSupplierexpectFlashAttribute(String attribute, Object value)Assert a flash attribute's value.<T> GetMockMvcResponseResultSupplierexpectFlashAttribute(String attribute, org.hamcrest.Matcher<? super T> matcherValue)Assert a flash attribute's value with the given HamcrestMatcher.GetMockMvcResponseResultSupplierexpectFlashAttributeCount(int count)Assert the number of flash attributes.GetMockMvcResponseResultSupplierexpectFlashAttributes(String... names)Assert the existence of the given flash attributes.GetMockMvcResponseResultSupplierexpectForward(String expectedUrl)Asserts the request was forwarded to the given URL.GetMockMvcResponseResultSupplierexpectForwardPattern(String urlPattern)Asserts the request was forwarded to the given URL.GetMockMvcResponseResultSupplierexpectForwardTemplate(String urlTemplate, Object... uriVars)Asserts the request was forwarded to the given URL template.GetMockMvcResponseResultSupplierexpectHandler(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.GetMockMvcResponseResultSupplierexpectHandlerMethod(Method method)Assert the controller method used to process the request.GetMockMvcResponseResultSupplierexpectHandlerMethod(String methodName)Assert the name of the controller method used to process the request.GetMockMvcResponseResultSupplierexpectHandlerMethod(org.hamcrest.Matcher<? super String> methodNameMatcher)Assert the name of the controller method used to process the request using the given HamcrestMatcher.<T> GetMockMvcResponseResultSupplierexpectHandlerType(Class<T> handlerType)Assert the type of the handler that processed the request.GetMockMvcResponseResultSupplierexpectHeader(String headerName)Assert that the named response header exists.GetMockMvcResponseResultSupplierexpectHeader(Function<org.springframework.test.web.servlet.result.HeaderResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)Asserts header in fluent wayGetMockMvcResponseResultSupplierexpectHeaderValue(String headerName, String value)Assert the primary value of the response header as a String value.GetMockMvcResponseResultSupplierexpectHeaderValue(String headerName, org.hamcrest.Matcher<? super String> valueMatcher)Assert the primary value of the response header with the given Hamcrest StringMatcher.GetMockMvcResponseResultSupplierexpectHeaderValues(String headerName, String... values)Assert the values of the response header as String values.GetMockMvcResponseResultSupplierexpectHeaderValues(String headerName, org.hamcrest.Matcher<? super Iterable<String>> valuesMatcher)Assert the values of the response header with the given Hamcrest IterableMatcher.GetMockMvcResponseResultSupplierexpectJsonContent(String expectedJsonContent)Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.GetMockMvcResponseResultSupplierexpectJsonContent(String expectedJsonContent, boolean strict)Parse the response content and the given string as JSON and assert the two are "similar" - i.e.GetMockMvcResponseResultSupplierexpectJsonPath(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.GetMockMvcResponseResultSupplierexpectJsonPath(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> GetMockMvcResponseResultSupplierexpectJsonPath(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.GetMockMvcResponseResultSupplierexpectJsonPathValue(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> GetMockMvcResponseResultSupplierexpectJsonPathValue(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 HamcrestMatcherGetMockMvcResponseResultSupplierexpectModel(Function<org.springframework.test.web.servlet.result.ModelResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)Asserts model in fluent wayGetMockMvcResponseResultSupplierexpectModelAttribute(String attribute, Object value)Assert a model attribute value.<T> GetMockMvcResponseResultSupplierexpectModelAttribute(String attribute, org.hamcrest.Matcher<? super T> matcher)Assert a model attribute value with the given HamcrestMatcher.GetMockMvcResponseResultSupplierexpectModelAttributes(String... attributes)Assert the given model attributes exist.GetMockMvcResponseResultSupplierexpectNoResolvedException()Asserts that there is no exception raised by a handler and successfully resolved through aHandlerExceptionResolver.GetMockMvcResponseResultSupplierexpectRedirect(String expectedUrl)Asserts the request was redirected to the given URL.GetMockMvcResponseResultSupplierexpectRedirectPattern(String urlPattern)Asserts the request was redirected to the given URL.GetMockMvcResponseResultSupplierexpectRedirectTemplate(String urlTemplate, Object... uriVars)Asserts the request was redirected to the given URL template.GetMockMvcResponseResultSupplierexpectRequest(Function<org.springframework.test.web.servlet.result.RequestResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)Asserts the request in fluent wayGetMockMvcResponseResultSupplierexpectResolvedException()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 aHandlerExceptionResolveris 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 aHandlerExceptionResolveris 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 aHandlerExceptionResolveris an object of the defined class (not of any subclass) and has a message that suits defined HamcrestMatcherGetMockMvcResponseResultSupplierexpectResolvedException(org.hamcrest.Matcher<? super Throwable>... matchers)Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolverwith a HamcrestMatcherGetMockMvcResponseResultSupplierexpectStatus(int expected)Assert the response status code is equal to an integer valueGetMockMvcResponseResultSupplierexpectStatus(Function<org.springframework.test.web.servlet.result.StatusResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)Asserts the response status in fluent wayGetMockMvcResponseResultSupplierexpectStatus(org.hamcrest.Matcher<? super Integer> matcher)Assert the response status code with the given HamcrestMatcherGetMockMvcResponseResultSupplierexpectStatusIs1xxInformational()Assert the response status code is in the 1xx range.GetMockMvcResponseResultSupplierexpectStatusIs2xxSuccessful()Assert the response status code is in the 2xx range.GetMockMvcResponseResultSupplierexpectStatusIs3xxRedirection()Assert the response status code is in the 3xx range.GetMockMvcResponseResultSupplierexpectStatusIs4xxClientError()Assert the response status code is in the 4xx range.GetMockMvcResponseResultSupplierexpectStatusIs5xxServerError()Assert the response status code is in the 5xx range.GetMockMvcResponseResultSupplierexpectStatusReason(String reason)Assert the Servlet response error message.GetMockMvcResponseResultSupplierexpectStatusReason(org.hamcrest.Matcher<? super String> matcher)Assert the Servlet response error message with the given HamcrestMatcher.GetMockMvcResponseResultSupplierexpectView(Function<org.springframework.test.web.servlet.result.ViewResultMatchers,org.springframework.test.web.servlet.ResultMatcher> createMatcher)Asserts view in fluent wayGetMockMvcResponseResultSupplierexpectViewName(String name)Assert the selected view name.GetMockMvcResponseResultSupplierexpectViewName(org.hamcrest.Matcher<? super String> nameMatcher)Assert the selected view name with the given HamcrestMatcher.GetMockMvcResponseResultSupplierexpectXmlContent(String xmlContent)Parse the response content and the given string as XML and assert the two are "similar" - i.e.GetMockMvcResponseResultSupplierexpectXPath(String expression, Object... xPathArgs)Evaluate the XPath and assert that content exists.GetMockMvcResponseResultSupplierexpectXPath(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 wayGetMockMvcResponseResultSupplierexpectXPath(String expression, Map<String,String> namespaces, Object... xPathArgs)Evaluate the XPath and assert that content exists.GetMockMvcResponseResultSupplierexpectXPath(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 wayGetMockMvcResponseResultSupplierexpectXPathNode(String expression, Map<String,String> namespaces, org.hamcrest.Matcher<? super Node> matcher, Object... xPathArgs)Evaluate the XPath and assert theNodecontent found with the given HamcrestMatcher.GetMockMvcResponseResultSupplierexpectXPathNode(String expression, org.hamcrest.Matcher<? super Node> matcher, Object... xPathArgs)Evaluate the XPath and assert theNodecontent found with the given HamcrestMatcher.GetMockMvcResponseResultSupplierexpectXPathNodeCount(String expression, int count, Object... xPathArgs)Evaluate the XPath and assert the number of nodes found.GetMockMvcResponseResultSupplierexpectXPathNodeCount(String expression, Map<String,String> namespaces, int count, Object... xPathArgs)Evaluate the XPath and assert the number of nodes found.GetMockMvcResponseResultSupplierexpectXPathNodeList(String expression, Map<String,String> namespaces, org.hamcrest.Matcher<? super NodeList> matcher, Object... xPathArgs)Evaluate the XPath and assert theNodeListcontent found with the given HamcrestMatcher.GetMockMvcResponseResultSupplierexpectXPathNodeList(String expression, org.hamcrest.Matcher<? super NodeList> matcher, Object... xPathArgs)Evaluate the XPath and assert theNodeListcontent found with the given HamcrestMatcher.protected voidonFailure(MockMvcContext mockMvcContext, Throwable throwable)Some additional action if the step is failedprotected voidonSuccess(org.springframework.mock.web.MockHttpServletResponse mockHttpServletResponse)Some additional action if the step is successfulstatic GetMockMvcResponseResultSupplierresponse(org.springframework.test.web.servlet.MockMvc mockMvc, org.springframework.test.web.servlet.RequestBuilder builder)Creates a step that gets a response.static GetMockMvcResponseResultSupplierresponse(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 anIterablefrom 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 anIterablefrom 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 anIterablefrom 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 anIterablefrom 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 anIterablefrom 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 anIterablefrom 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 anIterablefrom 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 anIterablefrom 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 ofMockMvcbuilder- 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 theNodecontent found with the given HamcrestMatcher.
-
expectXPathNode
public GetMockMvcResponseResultSupplier expectXPathNode(String expression, org.hamcrest.Matcher<? super Node> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNodecontent 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 theNodeListcontent found with the given HamcrestMatcher.
-
expectXPathNodeList
public GetMockMvcResponseResultSupplier expectXPathNodeList(String expression, org.hamcrest.Matcher<? super NodeList> matcher, Object... xPathArgs)
Evaluate the XPath and assert theNodeListcontent 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
strictparameter 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 aHandlerExceptionResolverwith a HamcrestMatcher
-
expectResolvedException
public <T extends Exception> GetMockMvcResponseResultSupplier expectResolvedException(Class<T> exceptionClass)
Asserts exception raised by a handler and successfully resolved through aHandlerExceptionResolveris 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 aHandlerExceptionResolveris 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 aHandlerExceptionResolveris 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:SequentialGetStepSupplierSome additional action if the step is successful- Overrides:
onSuccessin 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:SequentialGetStepSupplierSome additional action if the step is failed- Overrides:
onFailurein 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:SequentialGetStepSupplierReturns additional parameters calculated during step execution- Overrides:
additionalParametersin 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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
Iterablefrom 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
Iterablefrom 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
Iterablefrom 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_TRANSFORMERis 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
Iterablefrom 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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
Iterablefrom 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
Iterablefrom 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
Iterablefrom 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_TRANSFORMERis 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
Iterablefrom 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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_TRANSFORMERis 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
-
-