Class AbstractApiTestHelper
java.lang.Object
org.uitnet.testing.smartfwk.api.core.AbstractApiActionHandler
- All Implemented Interfaces:
ApiAuthenticationProvider
public abstract class AbstractApiTestHelper 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 StringtargetServerNameprotected TestConfigManagertestConfigManager -
Constructor Summary
Constructors Constructor Description AbstractApiTestHelper(String appName, int sessionExpiryDurationInSeconds) -
Method Summary
Modifier and Type Method Description protected voidauthenticate(String profileName)AbstractApiTestHelperclone()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)protected voidsetBaseURL(String baseUrlKey)voidsetTargetServerName(String targetServerName)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
-
testConfigManager
-
activeProfileName
-
activeUserProfile
-
sessionExpiryDurationInSeconds
protected int sessionExpiryDurationInSeconds -
lastRequestAccessTimeInMs
protected long lastRequestAccessTimeInMs -
logoutRequest
protected boolean logoutRequest -
apiTestManager
-
targetServerName
-
-
Constructor Details
-
AbstractApiTestHelper
-
-
Method Details
-
setApiTestManager
-
setTargetServerName
-
setBaseURL
-
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
-