Package core.helpers

Class RestApiHelper

java.lang.Object
core.helpers.RestApiHelper

public class RestApiHelper
extends Object
  • Constructor Summary

    Constructors
    Constructor Description
    RestApiHelper()  
  • Method Summary

    Modifier and Type Method Description
    static void runApiContaining​(String identifier, String prefix, String getApi, String targetApiId, String variable, String targerApi)
    runApiContaining("name", "zzz_","getCompanies", "id","companyId","deleteCompany") get all companies with name containing zzz_, Then gets id of these companies, stores them in companyId variable And calls deleteCompany
    static void runApiEquals​(String identifier, String value, String getApi, String targetApiId, String variable, String targerApi)
    runApiEquals("name", "test123","getCompanies", "id","companyId","deleteCompany") get all companies with name equals test123, Then gets id of these companies And calls delete with id

    Methods inherited from class java.lang.Object

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

    • RestApiHelper

      public RestApiHelper()
  • Method Details

    • runApiContaining

      public static void runApiContaining​(String identifier, String prefix, String getApi, String targetApiId, String variable, String targerApi) throws org.json.JSONException
      runApiContaining("name", "zzz_","getCompanies", "id","companyId","deleteCompany") get all companies with name containing zzz_, Then gets id of these companies, stores them in companyId variable And calls deleteCompany
      Parameters:
      getApi - : api to search for identifier. eg. name containing "zzz"
      prefix - : value containing in getApi. eg. name containing "zzz"
      identifier - : api to call to get all values. eg. getCompanies
      targetApiId - : id used to call target api.eg. id for deleteCompany api
      variable - : variable the id is stored in csv keyword file. eg companyId
      targerApi - : api to call. eg. deleteCompany
      Throws:
      org.json.JSONException
    • runApiEquals

      public static void runApiEquals​(String identifier, String value, String getApi, String targetApiId, String variable, String targerApi) throws org.json.JSONException
      runApiEquals("name", "test123","getCompanies", "id","companyId","deleteCompany") get all companies with name equals test123, Then gets id of these companies And calls delete with id
      Parameters:
      getApi - : api to search for identifier. eg. name equals "test123"
      value - : value containing in getApi. eg. name equals "test123"
      identifier - : api to call to get all values. eg. getCompanies
      targetApiId - : id used to call target api.eg. id for deleteCompany api
      variable - : variable the id is stored in csv keyword file. eg companyId
      targerApi - : api to call. eg. deleteCompany
      Throws:
      org.json.JSONException