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 Summary
Fields Modifier and Type Field Description protected StringactiveProfileNameprotected UserProfileactiveUserProfileprotected ApiTestManagerapiTestManagerprotected StringappNameprotected StringbaseURLprotected longlastRequestAccessTimeInMsprotected booleanlogoutRequestprotected HttpSessionsessionprotected intsessionExpiryDurationInSecondsprotected StringtargetServerName -
Constructor Summary
Constructors Constructor Description AbstractApiActionHandler(String appName, int sessionExpiryDurationInSeconds, String targetServerName) -
Method Summary
Modifier and Type Method Description protected voidauthenticate(String profileName)AbstractApiActionHandlerclone()StringgetActiveProfileName()UserProfilegetActiveUserProfile()longgetLastRequestAccessTimeInMs()intgetSessionExpiryDurationInSeconds()HttpResponsehttpDelete(String relativeUrl, String responseContentType, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)HttpResponsehttpGet(String relativeUrl, String responseContentType, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)HttpResponsehttpPost(String relativeUrl, HttpRequest request, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)HttpResponsehttpPut(String relativeUrl, HttpRequest request, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)HttpResponsehttpUploadFormFiles(String relativeUrl, HttpMultipartRequest request, Integer connectTimeoutInSeconds, Integer readTimeoutInSeconds)protected booleanisSessionExpired()protected HttpResponseprepareResponse(okhttp3.OkHttpClient client, okhttp3.Request.Builder requestBuilder, boolean expectResponseBody, String targetURL)HttpSessionsetActiveProfileName(String profileName)voidsetApiTestManager(ApiTestManager apiTestManager)Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.uitnet.testing.smartfwk.api.core.ApiAuthenticationProvider
login, logout
-
Field Details
-
appName
-
baseURL
-
session
-
activeProfileName
-
activeUserProfile
-
sessionExpiryDurationInSeconds
protected int sessionExpiryDurationInSeconds -
lastRequestAccessTimeInMs
protected long lastRequestAccessTimeInMs -
logoutRequest
protected boolean logoutRequest -
apiTestManager
-
targetServerName
-
-
Constructor Details
-
AbstractApiActionHandler
-
-
Method Details
-
setApiTestManager
-
setActiveProfileName
-
authenticate
-
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
-
getSessionExpiryDurationInSeconds
public int getSessionExpiryDurationInSeconds() -
getLastRequestAccessTimeInMs
public long getLastRequestAccessTimeInMs() -
clone
-