Package io.virtualan.cucumblan.core
Class BaseStepDefinition
- java.lang.Object
-
- io.virtualan.cucumblan.core.BaseStepDefinition
-
public class BaseStepDefinition extends Object
The type Base step definition.- Author:
- Elan Thangamani
-
-
Constructor Summary
Constructors Constructor Description BaseStepDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVariable(String responseValue, String key)Add variable.voidauth(String username, String password)Read request by path param.voidbearer(String auth, String token)Read request by path param.voidcert(String identifier, String value)Read request by path param.voidcreateRequest(String body, String contentType)Create request.voidcreateRequest(String dummyString, String acceptContentType, String resource, String system)Create request.voidcreateRequest(String nameIgnore, Map<String,String> parameterMap)Create request.voiddeleteById(String dummyString, String acceptContentType, String resource, String system)Delete by id.voidloadAsGlobalParam(String responseKey, String key)Load as global param.voidloadGlobalParam(Map<String,String> globalParams)Load global param.voidloadGlobalParamFromFile()Load global param.voidloadRequest(String nameIgnore, Map<String,String> parameterMap)Load request.voidmockSingleResponse(String resource, String context)Mock single response.voidmodifyBooleanVariable(String responseValue, String key)Modify variable.voidmodifyDecimalVariable(String responseValue, String key)Modify variable.voidmodifyIntVariable(String responseValue, String key)Modify variable.voidmodifyRequest(String dummyString, String acceptContentType, String resource, String system)Modify request.voidmodifyStringVariable(String responseValue, String key)Modify variable.voidpatchRequest(String dummyString, String acceptContentType, String resource, String system)Pathch request.voidreadAllHeaderParams(String nameIgnore, Map<String,String> parameterMap)Read request.voidreadPathParamsRequest(String nameIgnore, Map<String,String> parameterMap)Read request.voidreadRequest(String dummyString, String acceptContentType, String resource, String system)Read request.voidreadRequest(String nameIgnore, Map<String,String> parameterMap)Read request.voidreadRequestByHeaderParam(String dummy, String identifier, String value)Read request by header param.voidreadRequestByPathParam(String dummy)Read request by path param.voidreadRequestByPathParam(String dummy, String identifier, String value)Read request by path param.voidreadRequestByQueryParam(String dummy, String identifier, String value)Read request by query param.voidupdateRequest(String nameIgnore, Map<String,String> parameterMap)Update request.voidvalidateGlobalParam()Validate global param.voidverifyResponse(String dummyString, io.cucumber.datatable.DataTable data)Verify response.voidverifyResponseMapson(String resource, io.cucumber.datatable.DataTable data)Verify response.voidverifyStatusCode(int statusCode)Verify status code.
-
-
-
Method Detail
-
readRequestByPathParam
@Given("^(.*) with an path param (.*) of (.*)") public void readRequestByPathParam(String dummy, String identifier, String value)Read request by path param.- Parameters:
dummy- the dummyidentifier- the identifiervalue- the value
-
cert
@Given("^enable cert for (.*) of (.*)") public void cert(String identifier, String value)Read request by path param.- Parameters:
identifier- the identifiervalue- the value
-
auth
@Given("^basic authentication with (.*) and (.*)") public void auth(String username, String password)Read request by path param.- Parameters:
username- the identifierpassword- the value
-
bearer
@Given("^(.*) auth with (.*) token$") public void bearer(String auth, String token)Read request by path param.- Parameters:
auth- the identifiertoken- the value
-
readRequestByPathParam
@Given("^(.*) perform a api action") public void readRequestByPathParam(String dummy)Read request by path param.- Parameters:
dummy- the dummy
-
readRequestByHeaderParam
@Given("^(.*) with an header param (.*) of (.*)") public void readRequestByHeaderParam(String dummy, String identifier, String value)Read request by header param.- Parameters:
dummy- the dummyidentifier- the identifiervalue- the value
-
readAllHeaderParams
@Given("add (.*) with given header params$") public void readAllHeaderParams(String nameIgnore, Map<String,String> parameterMap) throws ExceptionRead request.- Parameters:
nameIgnore- the name ignoreparameterMap- the parameter map- Throws:
Exception- the exception
-
readRequestByQueryParam
@Given("^(.*) with an query param (.*) of (.*)") public void readRequestByQueryParam(String dummy, String identifier, String value)Read request by query param.- Parameters:
dummy- the dummyidentifier- the identifiervalue- the value
-
loadGlobalParam
@Given("^Provided all the feature level parameters$") public void loadGlobalParam(Map<String,String> globalParams) throws IOExceptionLoad global param.- Parameters:
globalParams- the global params- Throws:
IOException- the io exception
-
loadGlobalParamFromFile
@Given("^Provided all the feature level parameters from file$") public void loadGlobalParamFromFile() throws IOExceptionLoad global param.- Throws:
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(String responseValue, String key)Add variable.- Parameters:
responseValue- the response valuekey- the key
-
modifyDecimalVariable
@Given("^evaluate the (.*) decimal value of the key as (.*)") public void modifyDecimalVariable(String responseValue, String key) throws IOExceptionModify variable.- Parameters:
responseValue- the response valuekey- the key- Throws:
IOException- the io exception
-
modifyIntVariable
@Given("^evaluate the (.*) integer value of the key as (.*)") public void modifyIntVariable(String responseValue, String key) throws IOExceptionModify variable.- Parameters:
responseValue- the response valuekey- the key- Throws:
IOException- the io exception
-
modifyBooleanVariable
@Given("^evaluate the (.*) boolean value of the key as (.*)") public void modifyBooleanVariable(String responseValue, String key) throws IOExceptionModify variable.- Parameters:
responseValue- the response valuekey- the key- Throws:
IOException- the io exception
-
modifyStringVariable
@Given("^Modify the (.*) value of the key as (.*)") public void modifyStringVariable(String responseValue, String key) throws IOExceptionModify variable.- Parameters:
responseValue- the response valuekey- the key- Throws:
IOException- the io exception
-
loadAsGlobalParam
@Given("^Store the (.*) value of the key as (.*)") public void loadAsGlobalParam(String responseKey, String key)Load as global param.- Parameters:
responseKey- the response keykey- the key
-
readPathParamsRequest
@Given("^add (.*) with given path params$") public void readPathParamsRequest(String nameIgnore, Map<String,String> parameterMap) throws ExceptionRead request.- Parameters:
nameIgnore- the name ignoreparameterMap- the parameter map- Throws:
Exception- the exception
-
readRequest
@Given("add (.*) with given query params$") public void readRequest(String nameIgnore, Map<String,String> parameterMap) throws ExceptionRead request.- Parameters:
nameIgnore- the name ignoreparameterMap- the parameter map- Throws:
Exception- the exception
-
loadRequest
@Given("^Populate (.*) with given input$") public void loadRequest(String nameIgnore, Map<String,String> parameterMap) throws ExceptionLoad request.- Parameters:
nameIgnore- the name ignoreparameterMap- the parameter map- Throws:
Exception- the exception
-
createRequest
@Given("^add (.*) data with (.*) given input$") public void createRequest(String body, String contentType) throws ExceptionCreate request.- Parameters:
body- the bodycontentType- the content type- Throws:
Exception- the exception
-
createRequest
@Given("^Create (.*) with given input$") public void createRequest(String nameIgnore, Map<String,String> parameterMap) throws ExceptionCreate request.- Parameters:
nameIgnore- the name ignoreparameterMap- the parameter map- Throws:
Exception- the exception
-
updateRequest
@Given("^Update (.*) with given input$") public void updateRequest(String nameIgnore, Map<String,String> parameterMap) throws ExceptionUpdate request.- Parameters:
nameIgnore- the name ignoreparameterMap- the parameter map- Throws:
Exception- the exception
-
createRequest
@When("^(.*) post (.*) in (.*) resource on (.*)") public void createRequest(String dummyString, String acceptContentType, String resource, String system)Create request.- Parameters:
dummyString- the dummy stringacceptContentType- the accept content typeresource- the resourcesystem- the system
-
readRequest
@When("^(.*) get (.*) in (.*) resource on (.*)") public void readRequest(String dummyString, String acceptContentType, String resource, String system)Read request.- Parameters:
dummyString- the dummy stringacceptContentType- the accept content typeresource- the resourcesystem- the system
-
modifyRequest
@When("^(.*) put (.*) in (.*) resource on (.*)") public void modifyRequest(String dummyString, String acceptContentType, String resource, String system)Modify request.- Parameters:
dummyString- the dummy stringacceptContentType- the accept content typeresource- the resourcesystem- the system
-
patchRequest
@When("^(.*) patch (.*) in (.*) resource on (.*)") public void patchRequest(String dummyString, String acceptContentType, String resource, String system)Pathch request.- Parameters:
dummyString- the dummy stringacceptContentType- the accept content typeresource- the resourcesystem- the system
-
deleteById
@When("^(.*) delete (.*) in (.*) resource on (.*)") public void deleteById(String dummyString, String acceptContentType, String resource, String system)Delete by id.- Parameters:
dummyString- the dummy stringacceptContentType- the accept content typeresource- the resourcesystem- 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 (.*) api includes following in the response$") public void verifyResponseMapson(String resource, io.cucumber.datatable.DataTable data) throws ThrowableVerify response.- Parameters:
resource- the resourcedata- the data- Throws:
Throwable- the throwable
-
mockSingleResponse
@And("^Verify (.*) response with (.*) includes in the response$") public void mockSingleResponse(String resource, String context) throws ThrowableMock single response.- Parameters:
resource- the resourcecontext- the context- Throws:
Throwable- the throwable
-
-