Class SendRequestActionRaw
- java.lang.Object
-
- ru.tinkoff.qa.neptune.core.api.steps.SequentialActionSupplier<WebTestClientContext,org.springframework.test.web.reactive.server.WebTestClient,SELF>
-
- ru.tinkoff.qa.neptune.spring.web.testclient.SendRequestAction<byte[],ru.tinkoff.qa.neptune.spring.web.testclient.BodySpecFunction.RawBodySpecFunction,SendRequestActionRaw>
-
- ru.tinkoff.qa.neptune.spring.web.testclient.SendRequestActionRaw
-
- All Implemented Interfaces:
Supplier<ru.tinkoff.qa.neptune.core.api.steps.Action<WebTestClientContext>>
,ru.tinkoff.qa.neptune.core.api.steps.parameters.StepParameterPojo
public final class SendRequestActionRaw extends SendRequestAction<byte[],ru.tinkoff.qa.neptune.spring.web.testclient.BodySpecFunction.RawBodySpecFunction,SendRequestActionRaw>
Performs the sending of a request. Response body is read as raw byte-content.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ru.tinkoff.qa.neptune.core.api.steps.SequentialActionSupplier
ru.tinkoff.qa.neptune.core.api.steps.SequentialActionSupplier.DefaultActionParameterReader, ru.tinkoff.qa.neptune.core.api.steps.SequentialActionSupplier.DefinePerformImperativeParameterName, ru.tinkoff.qa.neptune.core.api.steps.SequentialActionSupplier.DefinePerformOnParameterName
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SendRequestActionRaw
expectBodyJson(String expectedJson)
Defines expected JSON-content.SendRequestActionRaw
expectBodyJsonPath(String expression, Object... args)
Evaluate the JSON path expression against the response body content and assert that a non-null value, possibly an empty array or map, exists at the given path.SendRequestActionRaw
expectBodyJsonPath(String expression, Function<org.springframework.test.web.reactive.server.JsonPathAssertions,org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec> assertion, Object... args)
Defines specification how to check response body by json-path.SendRequestActionRaw
expectBodyJsonPathEquals(String expression, Object expectedValue, Object... args)
Evaluate the JSON path expression against response body content and assert that the result is equal to the expected value.<T> SendRequestActionRaw
expectBodyJsonPathMatches(String expression, Class<T> targetType, org.hamcrest.Matcher<? super T> matcher, Object... args)
<T> SendRequestActionRaw
expectBodyJsonPathMatches(String expression, org.hamcrest.Matcher<T> matcher, Object... args)
Evaluate the JSON path expression against the response body content and assert the resulting value with the givenMatcher
.SendRequestActionRaw
expectBodyXml(String expectedXml)
Defines expected XML-content.SendRequestActionRaw
expectBodyXpath(String expression, Object... args)
Apply the XPath expression and assert the resulting content exists.SendRequestActionRaw
expectBodyXpath(String expression, Function<org.springframework.test.web.reactive.server.XpathAssertions,org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec> assertion, Object... args)
Defines specification how to check response body by xpath.SendRequestActionRaw
expectBodyXpath(String expression, Function<org.springframework.test.web.reactive.server.XpathAssertions,org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec> assertion, Map<String,String> namespaces, Object... args)
Defines specification how to check response body by xpath.SendRequestActionRaw
expectBodyXpath(String expression, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content exists.SendRequestActionRaw
expectBodyXpathEquals(String expression, String value, Object... args)
Apply the XPath expression and assert the resulting content as a String.SendRequestActionRaw
expectBodyXpathEquals(String expression, String value, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content as a String.SendRequestActionRaw
expectBodyXpathMatches(String expression, org.hamcrest.Matcher<? super String> matcher, Object... args)
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.SendRequestActionRaw
expectBodyXpathMatches(String expression, org.hamcrest.Matcher<? super String> matcher, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.SendRequestActionRaw
expectBodyXpathNodeCount(String expression, int count, Object... args)
Apply the XPath expression and assert the resulting content as an integer.SendRequestActionRaw
expectBodyXpathNodeCount(String expression, int count, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content as an integer.SendRequestActionRaw
expectBodyXpathNodeCount(String expression, org.hamcrest.Matcher<? super Integer> matcher, Object... args)
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.SendRequestActionRaw
expectBodyXpathNodeCount(String expression, org.hamcrest.Matcher<? super Integer> matcher, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.SendRequestActionRaw
expectEmptyBody()
Defines specification of empty bodyGetObjectFromResponseBody<String>
thenGetBodyAsString()
Creates a step that returns body of response as string content.-
Methods inherited from class ru.tinkoff.qa.neptune.spring.web.testclient.SendRequestAction
additionalParameters, expectCacheControl, expectContentDisposition, expectContentLength, expectContentType, expectContentType, expectContentTypeCompatibleWith, expectContentTypeCompatibleWith, expectCookie, expectCookie, expectCookieDomain, expectCookieDomain, expectCookieHttpOnly, expectCookieMaxAge, expectCookieMaxAge, expectCookiePath, expectCookiePath, expectCookieSecure, expectCookieValue, expectCookieValue, expectExpires, expectHeader, expectHeader, expectHeaderValue, expectHeaderValue, expectHeaderValueMatches, expectHeaderValues, expectHeaderValues, expectHeaderValuesMatch, expectLastModified, expectLocation, expectStatus, expectStatus, expectStatus, expectStatusIs1xxInformational, expectStatusIs2xxSuccessful, expectStatusIs3xxRedirection, expectStatusIs4xxClientError, expectStatusIsis5xxServerError, howToPerform, send, send, send, send, send, send, thenGetArray, thenGetBody, thenGetList, thenGetValue, thenGetValueFromArray, thenGetValueFromIterable
-
-
-
-
Method Detail
-
expectBodyJson
public SendRequestActionRaw expectBodyJson(String expectedJson)
Defines expected JSON-content. It performs a "lenient" comparison verifying the same attribute-value pairs.Use of this option requires the JSONassert library on to be on the classpath.
- Parameters:
expectedJson
- the expected JSON content.- Returns:
- self-reference
-
expectBodyXml
public SendRequestActionRaw expectBodyXml(String expectedXml)
Defines expected XML-content. It asserts that response body and defined xml-string are "similar", i.e. they contain the same elements and attributes regardless of order.Use of this method requires the XMLUnit library on the classpath.
- Parameters:
expectedXml
- the expected XML content.- Returns:
- self-reference
-
expectBodyJsonPath
public SendRequestActionRaw expectBodyJsonPath(String expression, Function<org.springframework.test.web.reactive.server.JsonPathAssertions,org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec> assertion, Object... args)
Defines specification how to check response body by json-path.- Parameters:
expression
- is json-path expressionassertion
- specification how to check something which is calculated by defined json-pathargs
- arguments to parameterize the json-path expression- Returns:
- self-reference
-
expectBodyJsonPath
public SendRequestActionRaw expectBodyJsonPath(String expression, Object... args)
Evaluate the JSON path expression against the response body content and assert that a non-null value, possibly an empty array or map, exists at the given path.
-
expectBodyJsonPathEquals
public SendRequestActionRaw expectBodyJsonPathEquals(String expression, Object expectedValue, Object... args)
Evaluate the JSON path expression against response body content and assert that the result is equal to the expected value.
-
expectBodyJsonPathMatches
public <T> SendRequestActionRaw expectBodyJsonPathMatches(String expression, org.hamcrest.Matcher<T> matcher, Object... args)
Evaluate the JSON path expression against the response body content and assert the resulting value with the givenMatcher
.
-
expectBodyJsonPathMatches
public <T> SendRequestActionRaw expectBodyJsonPathMatches(String expression, Class<T> targetType, org.hamcrest.Matcher<? super T> matcher, Object... args)
The same asexpectBodyJsonPathMatches(String, Matcher, Object...)
. It also accepts a target type for the resulting value. This can be useful for matching numbers reliably for example coercing an integer into a double.
-
expectBodyXpath
public SendRequestActionRaw expectBodyXpath(String expression, Function<org.springframework.test.web.reactive.server.XpathAssertions,org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec> assertion, Object... args)
Defines specification how to check response body by xpath.- Parameters:
expression
- is xpath expressionassertion
- specification how to check something which is calculated by defined xpathargs
- arguments to parameterize the xpath-path expression- Returns:
- self-reference
-
expectBodyXpath
public SendRequestActionRaw expectBodyXpath(String expression, Function<org.springframework.test.web.reactive.server.XpathAssertions,org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec> assertion, Map<String,String> namespaces, Object... args)
Defines specification how to check response body by xpath.- Parameters:
expression
- expression is xpath expressionassertion
- specification how to check something which is calculated by defined xpathnamespaces
- the namespaces to useargs
- arguments to parameterize the xpath-path expression- Returns:
- self-reference
-
expectBodyXpath
public SendRequestActionRaw expectBodyXpath(String expression, Object... args)
Apply the XPath expression and assert the resulting content exists.
-
expectBodyXpath
public SendRequestActionRaw expectBodyXpath(String expression, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content exists.
-
expectBodyXpathEquals
public SendRequestActionRaw expectBodyXpathEquals(String expression, String value, Object... args)
Apply the XPath expression and assert the resulting content as a String.
-
expectBodyXpathEquals
public SendRequestActionRaw expectBodyXpathEquals(String expression, String value, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content as a String.
-
expectBodyXpathMatches
public SendRequestActionRaw expectBodyXpathMatches(String expression, org.hamcrest.Matcher<? super String> matcher, Object... args)
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.
-
expectBodyXpathMatches
public SendRequestActionRaw expectBodyXpathMatches(String expression, org.hamcrest.Matcher<? super String> matcher, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.
-
expectBodyXpathNodeCount
public SendRequestActionRaw expectBodyXpathNodeCount(String expression, org.hamcrest.Matcher<? super Integer> matcher, Object... args)
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.
-
expectBodyXpathNodeCount
public SendRequestActionRaw expectBodyXpathNodeCount(String expression, org.hamcrest.Matcher<? super Integer> matcher, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.
-
expectBodyXpathNodeCount
public SendRequestActionRaw expectBodyXpathNodeCount(String expression, int count, Object... args)
Apply the XPath expression and assert the resulting content as an integer.
-
expectBodyXpathNodeCount
public SendRequestActionRaw expectBodyXpathNodeCount(String expression, int count, Map<String,String> namespaces, Object... args)
Apply the XPath expression and assert the resulting content as an integer.
-
expectEmptyBody
public SendRequestActionRaw expectEmptyBody()
Defines specification of empty body- Returns:
- self-reference
-
thenGetBodyAsString
public GetObjectFromResponseBody<String> thenGetBodyAsString()
Creates a step that returns body of response as string content.- Returns:
- an instance of
GetObjectFromResponseBody
-
-