@ Conditioned @ Et ( "Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du contexte[\\.|\\?]" ) @ And ( "I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' context key[\\.|\\?]" ) public void saveValue ( String method , String pageKey , String uri , String targetKey , List < GherkinStepCondition > conditions ) throws TechnicalException , FailureException { logger . debug ( "saveValue of REST API with method [{}]." , method ) ; logger . debug ( "saveValue of REST API with pageKey [{}]." , pageKey ) ; logger . debug ( "saveValue of REST API with uri [{}]." , uri ) ; logger . debug ( "saveValue of REST API in targetKey [{}]." , targetKey ) ; String json = null ; try { json = httpService . get ( Context . getUrlByPagekey ( pageKey ) , uri ) ; } catch ( HttpServiceException e ) { logger . error ( Messages . getMessage ( Messages . FAIL_MESSAGE_UNABLE_TO_CALL_API_REST ) , e ) ; new Result . Failure <> ( Context . getApplicationByPagekey ( pageKey ) , Messages . getMessage ( Messages . FAIL_MESSAGE_UNABLE_TO_CALL_API_REST ) , true , Context . getCallBack ( Callbacks . RESTART_WEB_DRIVER ) ) ; } Context . saveValue ( targetKey , json ) ; }
Save result of REST API in memory if all expected parameters equals actual parameters in conditions .