Class AbstractApiActionHandler

java.lang.Object
org.uitnet.testing.smartfwk.api.core.AbstractApiActionHandler
All Implemented Interfaces:
ApiAuthenticationProvider

public abstract class AbstractApiActionHandler
extends Object
implements ApiAuthenticationProvider
Author:
Madhav Krishna
  • Field Details

    • appName

      protected String appName
    • baseURL

      protected String baseURL
    • session

      protected HttpSession session
    • activeProfileName

      protected String activeProfileName
    • activeUserProfile

      protected UserProfile activeUserProfile
    • sessionExpiryDurationInSeconds

      protected int sessionExpiryDurationInSeconds
    • lastRequestAccessTimeInMs

      protected long lastRequestAccessTimeInMs
    • logoutRequest

      protected boolean logoutRequest
    • apiTestManager

      protected ApiTestManager apiTestManager
    • targetServerName

      protected String targetServerName
  • Constructor Details

    • AbstractApiActionHandler

      public AbstractApiActionHandler​(String appName, int sessionExpiryDurationInSeconds, String targetServerName)
  • Method Details

    • setApiTestManager

      public void setApiTestManager​(ApiTestManager apiTestManager)
    • setActiveProfileName

      public HttpSession setActiveProfileName​(String profileName)
    • authenticate

      protected void authenticate​(String profileName)
    • getActiveProfileName

      public String getActiveProfileName()
    • httpGet

      public HttpResponse httpGet​(String relativeUrl, String responseContentType, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)
    • httpDelete

      public HttpResponse httpDelete​(String relativeUrl, String responseContentType, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)
    • httpPost

      public HttpResponse httpPost​(String relativeUrl, HttpRequest request, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)
    • httpPut

      public HttpResponse httpPut​(String relativeUrl, HttpRequest request, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)
    • httpUploadFormFiles

      public HttpResponse httpUploadFormFiles​(String relativeUrl, HttpMultipartRequest request, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)
    • prepareResponse

      protected HttpResponse prepareResponse​(okhttp3.OkHttpClient client, okhttp3.Request.Builder requestBuilder, boolean expectResponseBody, String targetURL)
    • isSessionExpired

      protected boolean isSessionExpired()
    • getActiveUserProfile

      public UserProfile getActiveUserProfile()
    • getSessionExpiryDurationInSeconds

      public int getSessionExpiryDurationInSeconds()
    • getLastRequestAccessTimeInMs

      public long getLastRequestAccessTimeInMs()
    • clone

      public AbstractApiActionHandler clone()
      Overrides:
      clone in class Object