@ When ( "^I send a '(.+?)' request to '(.+?)'( with user and password '(.+:.+?)')? based on '([^:]+?)'( as '(json|string|gov)')? with:$" ) public void sendRequest ( String requestType , String endPoint , String foo , String loginInfo , String baseData , String baz , String type , DataTable modifications ) throws Exception { // Retrieve data String retrievedData = commonspec . retrieveData ( baseData , type ) ; // Modify data commonspec . getLogger ( ) . debug ( "Modifying data {} as {}" , retrievedData , type ) ; String modifiedData = commonspec . modifyData ( retrievedData , type , modifications ) . toString ( ) ; String user = null ; String password = null ; if ( loginInfo != null ) { user = loginInfo . substring ( 0 , loginInfo . indexOf ( ' ' ) ) ; password = loginInfo . substring ( loginInfo . indexOf ( ' ' ) + 1 , loginInfo . length ( ) ) ; } commonspec . getLogger ( ) . debug ( "Generating request {} to {} with data {} as {}" , requestType , endPoint , modifiedData , type ) ; Future < Response > response = commonspec . generateRequest ( requestType , false , user , password , endPoint , modifiedData , type , "" ) ; // Save response commonspec . getLogger ( ) . debug ( "Saving response" ) ; commonspec . setResponse ( requestType , response . get ( ) ) ; }
Send a request of the type specified