Class BaseStepDefinition


  • public class BaseStepDefinition
    extends java.lang.Object
    The type Base step definition.
    Author:
    Elan Thangamani
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addVariable​(java.lang.String responseValue, java.lang.String key)
      Add variable.
      void auth​(java.lang.String username, java.lang.String password)
      Read request by path param.
      void bearer​(java.lang.String auth, java.lang.String token)
      Read request by path param.
      void cert​(java.lang.String identifier, java.lang.String value)
      Read request by path param.
      void createRequest​(java.lang.String dummyString, java.lang.String acceptContentType, java.lang.String resource, java.lang.String system)
      Create request.
      void createRequest​(java.lang.String nameIgnore, java.util.Map<java.lang.String,​java.lang.String> parameterMap)
      Create request.
      void deleteById​(java.lang.String dummyString, java.lang.String acceptContentType, java.lang.String resource, java.lang.String system)
      Delete by id.
      void loadAsGlobalParam​(java.lang.String responseKey, java.lang.String key)
      Load as global param.
      void loadGlobalParam​(java.util.Map<java.lang.String,​java.lang.String> globalParams)
      Load global param.
      void loadGlobalParamFromFile()
      Load global param.
      void loadRequest​(java.lang.String nameIgnore, java.util.Map<java.lang.String,​java.lang.String> parameterMap)
      Load request.
      void modifyBooleanVariable​(java.lang.String responseValue, java.lang.String key)
      Modify variable.
      void modifyDecimalVariable​(java.lang.String responseValue, java.lang.String key)
      Modify variable.
      void modifyIntVariable​(java.lang.String responseValue, java.lang.String key)
      Modify variable.
      void modifyRequest​(java.lang.String dummyString, java.lang.String acceptContentType, java.lang.String resource, java.lang.String system)
      Modify request.
      void modifyStringVariable​(java.lang.String responseValue, java.lang.String key)
      Modify variable.
      void patchRequest​(java.lang.String dummyString, java.lang.String acceptContentType, java.lang.String resource, java.lang.String system)
      Pathch request.
      void readAllHeaderParams​(java.lang.String nameIgnore, java.util.Map<java.lang.String,​java.lang.String> parameterMap)
      Read request.
      void readPathParamsRequest​(java.lang.String nameIgnore, java.util.Map<java.lang.String,​java.lang.String> parameterMap)
      Read request.
      void readRequest​(java.lang.String dummyString, java.lang.String acceptContentType, java.lang.String resource, java.lang.String system)
      Read request.
      void readRequest​(java.lang.String nameIgnore, java.util.Map<java.lang.String,​java.lang.String> parameterMap)
      Read request.
      void readRequestByHeaderParam​(java.lang.String dummy, java.lang.String identifier, java.lang.String value)
      Read request by header param.
      void readRequestByPathParam​(java.lang.String dummy)
      Read request by path param.
      void readRequestByPathParam​(java.lang.String dummy, java.lang.String identifier, java.lang.String value)
      Read request by path param.
      void readRequestByQueryParam​(java.lang.String dummy, java.lang.String identifier, java.lang.String value)
      Read request by query param.
      void updateRequest​(java.lang.String nameIgnore, java.util.Map<java.lang.String,​java.lang.String> parameterMap)
      Update request.
      void validateGlobalParam()
      Validate global param.
      void verifyResponse​(java.lang.String dummyString, io.cucumber.datatable.DataTable data)
      Verify response.
      void verifyResponseMapson​(java.lang.String dummyString, io.cucumber.datatable.DataTable data)
      Verify response.
      void verifyStatusCode​(int statusCode)
      Verify status code.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BaseStepDefinition

        public BaseStepDefinition()
    • Method Detail

      • readRequestByPathParam

        @Given("^(.*) with an path param (.*) of (.*)")
        public void readRequestByPathParam​(java.lang.String dummy,
                                           java.lang.String identifier,
                                           java.lang.String value)
        Read request by path param.
        Parameters:
        dummy - the dummy
        identifier - the identifier
        value - the value
      • cert

        @Given("^enable cert for (.*) of (.*)")
        public void cert​(java.lang.String identifier,
                         java.lang.String value)
        Read request by path param.
        Parameters:
        identifier - the identifier
        value - the value
      • auth

        @Given("^basic authentication with (.*) and (.*)")
        public void auth​(java.lang.String username,
                         java.lang.String password)
        Read request by path param.
        Parameters:
        username - the identifier
        password - the value
      • bearer

        @Given("^(.*) auth with (.*) token$")
        public void bearer​(java.lang.String auth,
                           java.lang.String token)
        Read request by path param.
        Parameters:
        auth - the identifier
        token - the value
      • readRequestByPathParam

        @Given("^(.*) perform a api action")
        public void readRequestByPathParam​(java.lang.String dummy)
        Read request by path param.
        Parameters:
        dummy - the dummy
      • readRequestByHeaderParam

        @Given("^(.*) with an header param (.*) of (.*)")
        public void readRequestByHeaderParam​(java.lang.String dummy,
                                             java.lang.String identifier,
                                             java.lang.String value)
        Read request by header param.
        Parameters:
        dummy - the dummy
        identifier - the identifier
        value - the value
      • readAllHeaderParams

        @Given("add (.*) with given header params$")
        public void readAllHeaderParams​(java.lang.String nameIgnore,
                                        java.util.Map<java.lang.String,​java.lang.String> parameterMap)
                                 throws java.lang.Exception
        Read request.
        Parameters:
        nameIgnore - the name ignore
        parameterMap - the parameter map
        Throws:
        java.lang.Exception - the exception
      • readRequestByQueryParam

        @Given("^(.*) with an query param (.*) of (.*)")
        public void readRequestByQueryParam​(java.lang.String dummy,
                                            java.lang.String identifier,
                                            java.lang.String value)
        Read request by query param.
        Parameters:
        dummy - the dummy
        identifier - the identifier
        value - the value
      • loadGlobalParam

        @Given("^Provided all the feature level parameters$")
        public void loadGlobalParam​(java.util.Map<java.lang.String,​java.lang.String> globalParams)
                             throws java.io.IOException
        Load global param.
        Parameters:
        globalParams - the global params
        Throws:
        java.io.IOException - the io exception
      • loadGlobalParamFromFile

        @Given("^Provided all the feature level parameters from file$")
        public void loadGlobalParamFromFile()
                                     throws java.io.IOException
        Load global param.
        Throws:
        java.io.IOException - the io exception
      • validateGlobalParam

        @Then("^Verify all the feature level parameters exists")
        public void validateGlobalParam()
        Validate global param.
      • addVariable

        @Given("^Add the (.*) value of the key as (.*)")
        public void addVariable​(java.lang.String responseValue,
                                java.lang.String key)
        Add variable.
        Parameters:
        responseValue - the response value
        key - the key
      • modifyDecimalVariable

        @Given("^evaluate the (.*) decimal value of the key as (.*)")
        public void modifyDecimalVariable​(java.lang.String responseValue,
                                          java.lang.String key)
                                   throws java.io.IOException
        Modify variable.
        Parameters:
        responseValue - the response value
        key - the key
        Throws:
        java.io.IOException - the io exception
      • modifyIntVariable

        @Given("^evaluate the (.*) integer value of the key as (.*)")
        public void modifyIntVariable​(java.lang.String responseValue,
                                      java.lang.String key)
                               throws java.io.IOException
        Modify variable.
        Parameters:
        responseValue - the response value
        key - the key
        Throws:
        java.io.IOException - the io exception
      • modifyBooleanVariable

        @Given("^evaluate the (.*) boolean value of the key as (.*)")
        public void modifyBooleanVariable​(java.lang.String responseValue,
                                          java.lang.String key)
                                   throws java.io.IOException
        Modify variable.
        Parameters:
        responseValue - the response value
        key - the key
        Throws:
        java.io.IOException - the io exception
      • modifyStringVariable

        @Given("^Modify the (.*) value of the key as (.*)")
        public void modifyStringVariable​(java.lang.String responseValue,
                                         java.lang.String key)
                                  throws java.io.IOException
        Modify variable.
        Parameters:
        responseValue - the response value
        key - the key
        Throws:
        java.io.IOException - the io exception
      • loadAsGlobalParam

        @Given("^Store the (.*) value of the key as (.*)")
        public void loadAsGlobalParam​(java.lang.String responseKey,
                                      java.lang.String key)
        Load as global param.
        Parameters:
        responseKey - the response key
        key - the key
      • readPathParamsRequest

        @Given("^add (.*) with given path params$")
        public void readPathParamsRequest​(java.lang.String nameIgnore,
                                          java.util.Map<java.lang.String,​java.lang.String> parameterMap)
                                   throws java.lang.Exception
        Read request.
        Parameters:
        nameIgnore - the name ignore
        parameterMap - the parameter map
        Throws:
        java.lang.Exception - the exception
      • readRequest

        @Given("add (.*) with given query params$")
        public void readRequest​(java.lang.String nameIgnore,
                                java.util.Map<java.lang.String,​java.lang.String> parameterMap)
                         throws java.lang.Exception
        Read request.
        Parameters:
        nameIgnore - the name ignore
        parameterMap - the parameter map
        Throws:
        java.lang.Exception - the exception
      • loadRequest

        @Given("^Populate (.*) with given input$")
        public void loadRequest​(java.lang.String nameIgnore,
                                java.util.Map<java.lang.String,​java.lang.String> parameterMap)
                         throws java.lang.Exception
        Load request.
        Parameters:
        nameIgnore - the name ignore
        parameterMap - the parameter map
        Throws:
        java.lang.Exception - the exception
      • createRequest

        @Given("^Create (.*) with given input$")
        public void createRequest​(java.lang.String nameIgnore,
                                  java.util.Map<java.lang.String,​java.lang.String> parameterMap)
                           throws java.lang.Exception
        Create request.
        Parameters:
        nameIgnore - the name ignore
        parameterMap - the parameter map
        Throws:
        java.lang.Exception - the exception
      • updateRequest

        @Given("^Update (.*) with given input$")
        public void updateRequest​(java.lang.String nameIgnore,
                                  java.util.Map<java.lang.String,​java.lang.String> parameterMap)
                           throws java.lang.Exception
        Update request.
        Parameters:
        nameIgnore - the name ignore
        parameterMap - the parameter map
        Throws:
        java.lang.Exception - the exception
      • createRequest

        @When("^(.*) post (.*) in (.*) resource on (.*)")
        public void createRequest​(java.lang.String dummyString,
                                  java.lang.String acceptContentType,
                                  java.lang.String resource,
                                  java.lang.String system)
        Create request.
        Parameters:
        dummyString - the dummy string
        acceptContentType - the accept content type
        resource - the resource
        system - the system
      • readRequest

        @When("^(.*) get (.*) in (.*) resource on (.*)")
        public void readRequest​(java.lang.String dummyString,
                                java.lang.String acceptContentType,
                                java.lang.String resource,
                                java.lang.String system)
        Read request.
        Parameters:
        dummyString - the dummy string
        acceptContentType - the accept content type
        resource - the resource
        system - the system
      • modifyRequest

        @When("^(.*) put (.*) in (.*) resource on (.*)")
        public void modifyRequest​(java.lang.String dummyString,
                                  java.lang.String acceptContentType,
                                  java.lang.String resource,
                                  java.lang.String system)
        Modify request.
        Parameters:
        dummyString - the dummy string
        acceptContentType - the accept content type
        resource - the resource
        system - the system
      • patchRequest

        @When("^(.*) patch (.*) in (.*) resource on (.*)")
        public void patchRequest​(java.lang.String dummyString,
                                 java.lang.String acceptContentType,
                                 java.lang.String resource,
                                 java.lang.String system)
        Pathch request.
        Parameters:
        dummyString - the dummy string
        acceptContentType - the accept content type
        resource - the resource
        system - the system
      • deleteById

        @When("^(.*) delete (.*) in (.*) resource on (.*)")
        public void deleteById​(java.lang.String dummyString,
                               java.lang.String acceptContentType,
                               java.lang.String resource,
                               java.lang.String system)
        Delete by id.
        Parameters:
        dummyString - the dummy string
        acceptContentType - the accept content type
        resource - the resource
        system - the system
      • verifyStatusCode

        @Then("^Verify the status code is (\\d+)")
        public void verifyStatusCode​(int statusCode)
        Verify status code.
        Parameters:
        statusCode - the status code
      • verifyResponseMapson

        @And("^Verify-all (.*) includes following in the response$")
        public void verifyResponseMapson​(java.lang.String dummyString,
                                         io.cucumber.datatable.DataTable data)
                                  throws java.lang.Throwable
        Verify response.
        Parameters:
        dummyString - the dummy string
        data - the data
        Throws:
        java.lang.Throwable - the throwable
      • verifyResponse

        @And("^Verify (.*) includes following in the response$")
        public void verifyResponse​(java.lang.String dummyString,
                                   io.cucumber.datatable.DataTable data)
                            throws java.lang.Throwable
        Verify response.
        Parameters:
        dummyString - the dummy string
        data - the data
        Throws:
        java.lang.Throwable - the throwable