Class SoapServiceGSpec


  • public class SoapServiceGSpec
    extends BaseGSpec
    Steps definitions for working with SOAP web services
    Author:
    Jose Fernandez
    • Constructor Detail

      • SoapServiceGSpec

        public SoapServiceGSpec​(CommonG spec)
    • Method Detail

      • theWebserviceWSDLIsLocatedIn

        @Given("^The webservice WSDL is located in \'(.+?)\'$")
        public void theWebserviceWSDLIsLocatedIn​(String remoteWsdlAddress)
                                          throws Throwable
        Indicates the library the location of the remote WSDL (descriptor of the remote webservice) This is an initialization step and must be provided before executing any other steps
        Parameters:
        remoteWsdlAddress - Remote URL of the WSDL document
        Throws:
        Throwable - Throwable
      • iExecuteTheMethodAddBasedOnSchemasAddRequestWith

        @When("^I execute the method \'(.+?)\' based on \'([^:]+?)\'( with:)?$")
        public void iExecuteTheMethodAddBasedOnSchemasAddRequestWith​(String actionName,
                                                                     String requestFile,
                                                                     String foo,
                                                                     io.cucumber.datatable.DataTable modifications)
                                                              throws Throwable
        Executes the remote method in the webservice. A request body must be provided for this operation. There is also the possibility of altering values of the request body before sending providing a datatable
        Parameters:
        actionName - Remote method to execute. The method name will be translated to the corresponding SOAPAction
        requestFile - File containing the request (XML)
        foo - parameter generated by cucumber because of the optional expression
        modifications - (Optional) a datatable with modifications to perform on the request before sending Example: Assuming the request XML body contains the following tags: <intA>int<intA/> <intB>int<intB/> To alter the value of intA and intB, a datatable like the following should be provided: | intA | 1 | | intB | 1 | And the corresponding values for the given tags in the body will be <intA>1<intA/> <intB>1<intB/>
        Throws:
        Throwable - Throwable
      • theResponseMatchesTheFollowingCases

        @Then("^The response matches the following cases:$")
        public void theResponseMatchesTheFollowingCases​(io.cucumber.datatable.DataTable results)
                                                 throws Throwable
        Evaluates the response of the remote websevice against a set of conditions provided by a datatable
        Parameters:
        results - Expected results in a datatable Example: Assuming the response from the webservice (XML response), contains the following XML tag: <AddResult>2<AddResult/> To verify that AddResult tag equals "2", a datatable like the following should be provided: | AddResult | equal | 2 | Suported operations: - equal - not equal - contains - does not contain - length
        Throws:
        Throwable - Throwable