public class APIMIntegrationBaseTest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected APIMTestCaseUtils |
apimTestCaseUtils |
protected APIPublisherRestClient |
apiPublisher |
protected APIStoreRestClient |
apiStore |
protected ApplicationManagementClient |
applicationManagementClient |
protected org.wso2.carbon.automation.engine.context.AutomationContext |
backEndServer |
protected APIMURLBean |
backEndServerUrl |
protected String |
executionMode |
protected org.wso2.carbon.automation.engine.context.AutomationContext |
gatewayContextMgt |
protected org.wso2.carbon.automation.engine.context.AutomationContext |
gatewayContextWrk |
protected String |
gatewayHTTPSURL |
protected APIMURLBean |
gatewayUrlsMgt |
protected APIMURLBean |
gatewayUrlsWrk |
protected int |
inboundWebSocketPort |
protected org.wso2.carbon.automation.engine.context.AutomationContext |
keyManagerContext |
protected String |
keyManagerHTTPSURL |
protected String |
keymanagerSessionCookie |
protected String |
keymanagerSuperTenantSessionCookie |
protected APIMURLBean |
keyMangerUrl |
protected OAuthAdminServiceClient |
oAuthAdminServiceClient |
protected int |
portOffset |
protected org.wso2.carbon.automation.engine.context.AutomationContext |
publisherContext |
protected String |
publisherURLHttp |
protected String |
publisherURLHttps |
protected APIMURLBean |
publisherUrls |
protected ClaimMetaDataMgtAdminClient |
remoteClaimMetaDataMgtAdminClient |
protected RemoteUserStoreManagerServiceClient |
remoteUserStoreManagerServiceClient |
protected RestAPIPublisherImpl |
restAPIPublisher |
protected RestAPIStoreImpl |
restAPIStore |
protected org.wso2.carbon.automation.engine.context.AutomationContext |
storeContext |
protected String |
storeURLHttp |
protected String |
storeURLHttps |
protected APIMURLBean |
storeUrls |
protected org.wso2.carbon.automation.engine.context.AutomationContext |
superTenantKeyManagerContext |
protected org.apache.axiom.om.OMElement |
synapseConfiguration |
protected org.wso2.carbon.integration.common.admin.client.TenantManagementServiceClient |
tenantManagementServiceClient |
protected org.wso2.carbon.automation.engine.context.beans.User |
user |
protected org.wso2.carbon.integration.common.admin.client.UserManagementClient |
userManagementClient |
protected org.wso2.carbon.automation.engine.context.TestUserMode |
userMode |
| Constructor and Description |
|---|
APIMIntegrationBaseTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanUp()
Cleaning up the API manager by removing all APIs and applications other than default application
|
protected String |
createSession(org.wso2.carbon.automation.engine.context.AutomationContext automationContext) |
protected String |
getAMResourceLocation()
Get test artifact resources location
|
protected String |
getAPIInvocationURLHttp(String apiContext) |
protected String |
getAPIInvocationURLHttp(String apiContext,
String version) |
protected String |
getAPIInvocationURLHttps(String apiContext) |
protected String |
getAPIInvocationURLHttps(String apiContext,
String version)
To get the API invocation in https with context and version.
|
protected String |
getBackendEndServiceEndPointHttp(String serviceName) |
protected String |
getBackendEndServiceEndPointHttps(String serviceName) |
protected String |
getGatewayMgtBackendURLHttps() |
protected String |
getGatewayMgtURLHttp() |
protected String |
getGatewayMgtURLHttps() |
protected String |
getGatewayURLHttp() |
protected String |
getGatewayURLHttps() |
protected String |
getGatewayURLNhttp() |
protected String |
getGatewayURLNhttps() |
protected String |
getKeyManagerURLHttp() |
protected String |
getKeyManagerURLHttps() |
protected String |
getPublisherURLHttp() |
protected String |
getPublisherURLHttps() |
protected RestAPIPublisherImpl |
getRestAPIPublisherForUser(String user,
String pass,
String tenantDomain) |
protected RestAPIStoreImpl |
getRestAPIStoreForAnonymousUser(String tenantDomain) |
protected RestAPIStoreImpl |
getRestAPIStoreForUser(String user,
String pass,
String tenantDomain) |
protected String |
getStoreURLHttp() |
protected String |
getStoreURLHttps() |
protected String |
getSuperTenantAPIInvocationURLHttp(String apiContext,
String version) |
protected String |
getWebSocketAPIInvocationURL(String apiContext,
String version) |
protected String |
getWebSocketTenantAPIInvocationURL(String apiContext,
String version,
String tenantDomain) |
protected void |
init()
This method will initialize test environment
based on user mode and configuration given at automation.xml
|
protected void |
init(String domainKey,
String userKey)
init the object with tenant domain, user key and instance of store,publisher and gateway
create context objects and construct URL bean
|
protected void |
init(org.wso2.carbon.automation.engine.context.TestUserMode userMode)
init the object with user mode , create context objects and get session cookies
|
protected void |
loadSynapseConfigurationFromClasspath(String relativeFilePath,
org.wso2.carbon.automation.engine.context.AutomationContext automationContext,
String sessionCookie) |
protected org.apache.http.Header |
pickHeader(org.apache.http.Header[] headers,
String requiredHeader) |
protected void |
updateSynapseConfiguration(org.apache.axiom.om.OMElement synapseConfig,
org.wso2.carbon.automation.engine.context.AutomationContext automationContext,
String sessionCookie)
update synapse config to server
|
protected void |
verifyResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse httpResponse) |
protected void |
waitForAPIDeployment()
This method can be used to wait for API deployment sync in distributed and clustered environment
APIStatusMonitor will be invoked to get API related data and then verify that data matches with
expected response provided.
|
protected void |
waitForAPIDeploymentSync(String apiProvider,
String apiName,
String apiVersion,
String expectedResponse)
This method can be used to wait for API deployment sync in distributed and clustered environment
APIStatusMonitor will be invoked to get API related data and then verify that data matches with
expected response provided.
|
protected void |
waitForAPIUnDeploymentSync(String apiProvider,
String apiName,
String apiVersion,
String expectedResponse)
This method can be used to wait for API Un-deployment sync in distributed and clustered environment
APIStatusMonitor will be invoked to get API related data and then verify that data matches with
expected response provided.
|
protected org.wso2.carbon.automation.engine.context.AutomationContext storeContext
protected org.wso2.carbon.automation.engine.context.AutomationContext publisherContext
protected org.wso2.carbon.automation.engine.context.AutomationContext keyManagerContext
protected org.wso2.carbon.automation.engine.context.AutomationContext gatewayContextMgt
protected org.wso2.carbon.automation.engine.context.AutomationContext gatewayContextWrk
protected org.wso2.carbon.automation.engine.context.AutomationContext backEndServer
protected org.wso2.carbon.automation.engine.context.AutomationContext superTenantKeyManagerContext
protected org.apache.axiom.om.OMElement synapseConfiguration
protected APIMTestCaseUtils apimTestCaseUtils
protected org.wso2.carbon.automation.engine.context.TestUserMode userMode
protected String executionMode
protected APIMURLBean storeUrls
protected APIMURLBean publisherUrls
protected APIMURLBean gatewayUrlsMgt
protected APIMURLBean gatewayUrlsWrk
protected APIMURLBean keyMangerUrl
protected APIMURLBean backEndServerUrl
protected org.wso2.carbon.automation.engine.context.beans.User user
protected APIPublisherRestClient apiPublisher
protected APIStoreRestClient apiStore
protected RestAPIPublisherImpl restAPIPublisher
protected RestAPIStoreImpl restAPIStore
protected org.wso2.carbon.integration.common.admin.client.UserManagementClient userManagementClient
protected RemoteUserStoreManagerServiceClient remoteUserStoreManagerServiceClient
protected ClaimMetaDataMgtAdminClient remoteClaimMetaDataMgtAdminClient
protected OAuthAdminServiceClient oAuthAdminServiceClient
protected ApplicationManagementClient applicationManagementClient
protected org.wso2.carbon.integration.common.admin.client.TenantManagementServiceClient tenantManagementServiceClient
protected String publisherURLHttp
protected String publisherURLHttps
protected String keyManagerHTTPSURL
protected String gatewayHTTPSURL
protected String storeURLHttp
protected String storeURLHttps
protected String keymanagerSessionCookie
protected String keymanagerSuperTenantSessionCookie
protected final int inboundWebSocketPort
protected final int portOffset
protected void init()
throws APIManagerIntegrationTestException
APIManagerIntegrationTestException - - if test configuration init failsprotected void init(org.wso2.carbon.automation.engine.context.TestUserMode userMode)
throws APIManagerIntegrationTestException
userMode - - user mode to run the testsAPIManagerIntegrationTestException - - if test configuration init failsprotected void init(String domainKey, String userKey) throws APIManagerIntegrationTestException
domainKey - - tenant domain keyuserKey - - tenant user keyAPIManagerIntegrationTestException - - if test configuration init failsprotected void loadSynapseConfigurationFromClasspath(String relativeFilePath, org.wso2.carbon.automation.engine.context.AutomationContext automationContext, String sessionCookie) throws APIManagerIntegrationTestException
relativeFilePath - - file path to load configAPIManagerIntegrationTestException - - Throws if load synapse configuration from file path
failsprotected String createSession(org.wso2.carbon.automation.engine.context.AutomationContext automationContext) throws APIManagerIntegrationTestException
automationContext - - automation context instance of given serverAPIManagerIntegrationTestException - - Throws if creating session cookie failsprotected String getAMResourceLocation()
protected void updateSynapseConfiguration(org.apache.axiom.om.OMElement synapseConfig,
org.wso2.carbon.automation.engine.context.AutomationContext automationContext,
String sessionCookie)
throws APIManagerIntegrationTestException
synapseConfig - - config to uploadautomationContext - - automation context of the server instancesessionCookie - - logged in session cookieAPIManagerIntegrationTestException - - If synapse config update failsprotected String getStoreURLHttp()
protected String getStoreURLHttps()
protected String getPublisherURLHttp()
protected String getPublisherURLHttps()
protected String getGatewayMgtURLHttp()
protected String getGatewayMgtBackendURLHttps()
protected String getGatewayMgtURLHttps()
protected String getGatewayURLHttp()
protected String getGatewayURLNhttp()
protected String getGatewayURLHttps()
protected String getGatewayURLNhttps()
protected String getKeyManagerURLHttp()
protected String getKeyManagerURLHttps() throws XPathExpressionException
XPathExpressionExceptionprotected String getAPIInvocationURLHttp(String apiContext) throws XPathExpressionException
XPathExpressionExceptionprotected String getAPIInvocationURLHttp(String apiContext, String version) throws XPathExpressionException
XPathExpressionExceptionprotected String getAPIInvocationURLHttps(String apiContext, String version) throws XPathExpressionException
apiContext - Relevant context of the API.version - Version of the API.XPathExpressionException - XPath Express Exception.protected String getWebSocketAPIInvocationURL(String apiContext, String version) throws XPathExpressionException
XPathExpressionExceptionprotected String getWebSocketTenantAPIInvocationURL(String apiContext, String version, String tenantDomain) throws XPathExpressionException
XPathExpressionExceptionprotected String getAPIInvocationURLHttps(String apiContext) throws XPathExpressionException
XPathExpressionExceptionprotected String getBackendEndServiceEndPointHttp(String serviceName)
protected String getBackendEndServiceEndPointHttps(String serviceName)
protected String getSuperTenantAPIInvocationURLHttp(String apiContext, String version) throws XPathExpressionException
XPathExpressionExceptionprotected void cleanUp()
throws Exception
APIManagerIntegrationTestException - - occurred when calling the apisExceptionprotected void verifyResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse httpResponse)
throws org.json.JSONException
org.json.JSONExceptionprotected void waitForAPIDeployment()
protected void waitForAPIDeploymentSync(String apiProvider, String apiName, String apiVersion, String expectedResponse) throws APIManagerIntegrationTestException, XPathExpressionException
apiProvider - - Provider of the APIapiName - - API nameapiVersion - - API versionexpectedResponse - - Expected responseAPIManagerIntegrationTestException - - Throws if something goes wrongXPathExpressionExceptionprotected void waitForAPIUnDeploymentSync(String apiProvider, String apiName, String apiVersion, String expectedResponse) throws APIManagerIntegrationTestException
apiProvider - - Provider of the APIapiName - - API nameapiVersion - - API versionexpectedResponse - - Expected responseAPIManagerIntegrationTestException - - Throws if something goes wrongprotected org.apache.http.Header pickHeader(org.apache.http.Header[] headers,
String requiredHeader)
protected RestAPIPublisherImpl getRestAPIPublisherForUser(String user, String pass, String tenantDomain)
protected RestAPIStoreImpl getRestAPIStoreForUser(String user, String pass, String tenantDomain)
protected RestAPIStoreImpl getRestAPIStoreForAnonymousUser(String tenantDomain)
Copyright © 2020 WSO2 Inc. All rights reserved.