Class 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.
    • 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 expression
        assertion - specification how to check something which is calculated by defined json-path
        args - 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 given Matcher.
      • 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 expression
        assertion - specification how to check something which is calculated by defined xpath
        args - 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 expression
        assertion - specification how to check something which is calculated by defined xpath
        namespaces - the namespaces to use
        args - 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.
      • expectBodyXpathEquals

        public SendRequestActionRaw expectBodyXpathEquals​(String expression,
                                                          String value,
                                                          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