Class APIStoreRestClient
- java.lang.Object
-
- org.wso2.am.integration.test.utils.clients.APIStoreRestClient
-
public class APIStoreRestClient extends Object
Provides set of method to invoke publisher API
-
-
Constructor Summary
Constructors Constructor Description APIStoreRestClient(String backendURL)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.wso2.carbon.automation.test.utils.http.client.HttpResponseaddApplication(String application, String tier, String callbackUrl, String description)Add applicationorg.wso2.carbon.automation.test.utils.http.client.HttpResponseaddApplicationWithCustomAttributes(String application, String tier, String callbackUrl, String description, String applicationAttributes)Add application with custom attributesorg.wso2.carbon.automation.test.utils.http.client.HttpResponseaddApplicationWithGroup(String application, String tier, String callbackUrl, String description, String groupId)Add application with Grouporg.wso2.carbon.automation.test.utils.http.client.HttpResponseaddApplicationWithTokenType(String application, String tier, String callbackUrl, String description, String tokenType)Add application with token typeorg.wso2.carbon.automation.test.utils.http.client.HttpResponseaddComment(String apiName, String version, String provider, String comment)Add comment to given APIorg.wso2.carbon.automation.test.utils.http.client.HttpResponseaddRatingToAPI(String apiName, String version, String provider, String rating)Add rating into apiorg.wso2.carbon.automation.test.utils.http.client.HttpResponsechangePassword(String username, String currentPassword, String newPassword)Change password of the userorg.wso2.carbon.automation.test.utils.http.client.HttpResponsecleanUpApplicationRegistrationByApplicationId(int applicationId, String applicationName)Clean up application registration by IDorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegenerateApplicationKey(APPKeyRequestGenerator generateAppKeyRequest)Generate tokenorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegenerateApplicationKeyById(APPKeyRequestGenerator generateAppKeyRequest)Generate tokenorg.apache.http.HttpResponsegenerateSDKUpdated(String sdkLanguage, String apiName, String apiVersion, String apiProvider, String tenant)Generate SDK for a given programming languageorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegenerateUserAccessKey(String consumeKey, String consumerSecret, String messageBody, URL tokenEndpointURL)Generate user access keyorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllApplications()Get all the applicationsorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllDocumentationOfAPI(String apiName, String version, String provider)Method to retrieve all documents of given apiorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllPaginatedPublishedAPIs(String tenant, int start, int end)Gell all paginated published apis for a given tenantorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllPaginatedPublishedAPIs(String tenant, String start, String end)Get all paginated published API for a given tenantorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllPublishedAPIs()Get all published apisorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllPublishedAPIs(String tenant)Get all published APIs for tenantorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllSubscriptions()Get all subscriptionsorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllSubscriptionsOfApplication()Get all subscriptions of Application.org.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllSubscriptionsOfApplication(String selectedApplication)Get all subscriptions of Application.org.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAllTags()Get all API tagsorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAPI()Get api which are publishedorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetApiEndpointUrls(String apiName, String version, String provider)Method to retrieve all endpoint urlsorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAPIListFromStoreAsAnonymousUser(String tenantDomain)org.wso2.carbon.automation.test.utils.http.client.HttpResponsegetAPIPageFilteredWithTags(String apiTag)Get the web page with filtered API when click the API Tag linkorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetApplicationById(int applicationId)Get application by IDorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetApplicationPage()Get application pageorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetApplications()Get applicationorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetPrototypedAPI(String tenant)Get Prototyped APIs in Storeorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetPublishedAPIsByApplication(String applicationName)Get application details by given nameorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetPublishedAPIsByApplicationId(String applicationName, int applicationId)Get application details by given nameorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetRecentlyAddedAPIs(String tenant, String limit)Get recently added APIs by tenantStringgetSession()Get the current session cookiesorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetSubscribedAPIs(String applicationName)Get subscribed Apis by application nameorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetSubscribedAPIs(String applicationName, String domain)Get subscribed APIs for the specific Applicationorg.wso2.carbon.automation.test.utils.http.client.HttpResponsegetSwaggerDocument(String userName, String apiName, String apiVersion, String executionMode)This method will return swagger document of given api name and versionorg.wso2.carbon.automation.test.utils.http.client.HttpResponseisCommentActivated()Check whether commenting is enabledorg.wso2.carbon.automation.test.utils.http.client.HttpResponseisRatingActivated()Check if API rating activatedorg.wso2.carbon.automation.test.utils.http.client.HttpResponselogin(String userName, String password)Login to API storeorg.wso2.carbon.automation.test.utils.http.client.HttpResponselogout()API Store logoutorg.wso2.carbon.automation.test.utils.http.client.HttpResponseregenerateConsumerSecret(String clientId)Regenerate consumer secret.org.wso2.carbon.automation.test.utils.http.client.HttpResponseremoveAPISubscription(String API, String version, String provider, String applicationId)Unsubscribe from APIorg.wso2.carbon.automation.test.utils.http.client.HttpResponseremoveAPISubscriptionByApplicationName(String API, String version, String provider, String applicationName)Unsubscribe from API by application nameorg.wso2.carbon.automation.test.utils.http.client.HttpResponseremoveAPISubscriptionByName(String API, String version, String provider, String appName)Unsubscribe from APIorg.wso2.carbon.automation.test.utils.http.client.HttpResponseremoveApplication(String application)Delete applicationorg.wso2.carbon.automation.test.utils.http.client.HttpResponseremoveApplicationById(int applicationId)Delete application by Idorg.wso2.carbon.automation.test.utils.http.client.HttpResponseremoveRatingFromAPI(String apiName, String version, String provider)Remove rating of given APIorg.wso2.carbon.automation.test.utils.http.client.HttpResponsesearchPaginateAPIs(String tenant, String start, String end, String searchTerm)org.wso2.carbon.automation.test.utils.http.client.HttpResponsesignUp(String userName, String password, String firstName, String lastName, String email)API Store sign uporg.wso2.carbon.automation.test.utils.http.client.HttpResponsesignUpforTenant(String userName, String password, String claims)API Store sign uporg.wso2.carbon.automation.test.utils.http.client.HttpResponsesignUpWithOrganization(String userName, String password, String firstName, String lastName, String email, String organization)API Store sign up with organizationorg.wso2.carbon.automation.test.utils.http.client.HttpResponsesubscribe(SubscriptionRequest subscriptionRequest)Subscribe to APIorg.wso2.carbon.automation.test.utils.http.client.HttpResponsesubscribe(SubscriptionRequest subscriptionRequest, String action)Subscribe to API using a particular actionorg.wso2.carbon.automation.test.utils.http.client.HttpResponsesubscribeToAPI(SubscriptionRequest subscriptionRequest)Subscribe and API.org.wso2.carbon.automation.test.utils.http.client.HttpResponseupdateApplication(String applicationOld, String applicationNew, String callbackUrlNew, String descriptionNew, String tier)Update given applicationorg.wso2.carbon.automation.test.utils.http.client.HttpResponseupdateApplicationById(int applicationId, String applicationOld, String applicationNew, String callbackUrlNew, String descriptionNew, String tier)Update given applicationorg.wso2.carbon.automation.test.utils.http.client.HttpResponseupdateClientApplication(String application, String keyType, String authorizedDomains, String retryAfterFailure, String jsonParams, String callbackUrl)Update given Auth applicationorg.wso2.carbon.automation.test.utils.http.client.HttpResponseupdateClientApplicationById(int applicationId, String application, String keyType, String authorizedDomains, String retryAfterFailure, String jsonParams, String callbackUrl)Update given Auth applicationvoidwaitForSwaggerDocument(String userName, String apiName, String apiVersion, String expectedResponse, String executionMode)Wait for swagger document until its updated.
-
-
-
Constructor Detail
-
APIStoreRestClient
public APIStoreRestClient(String backendURL)
-
-
Method Detail
-
login
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse login(String userName, String password) throws APIManagerIntegrationTestException
Login to API store- Parameters:
userName- - username to loginpassword- - password to login- Returns:
- - http response
- Throws:
APIManagerIntegrationTestException- - Throws if login to store fails
-
subscribe
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse subscribe(SubscriptionRequest subscriptionRequest) throws APIManagerIntegrationTestException
Subscribe to API- Parameters:
subscriptionRequest- - subscribe api request- Returns:
- - http response
- Throws:
APIManagerIntegrationTestException- - throws if subscription fails
-
subscribe
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse subscribe(SubscriptionRequest subscriptionRequest, String action) throws APIManagerIntegrationTestException
Subscribe to API using a particular action- Parameters:
subscriptionRequest- - subscribe api request- Returns:
- - http response
- Throws:
APIManagerIntegrationTestException- - throws if subscription fails
-
generateApplicationKey
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse generateApplicationKey(APPKeyRequestGenerator generateAppKeyRequest) throws APIManagerIntegrationTestException
Generate token- Parameters:
generateAppKeyRequest- - generate api key request- Returns:
- - http response
- Throws:
APIManagerIntegrationTestException- - throws if application key generation fails.
-
generateApplicationKeyById
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse generateApplicationKeyById(APPKeyRequestGenerator generateAppKeyRequest) throws APIManagerIntegrationTestException
Generate token- Parameters:
generateAppKeyRequest- - generate api key request- Returns:
- - http response
- Throws:
APIManagerIntegrationTestException- - throws if application key generation fails.
-
getAPI
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPI() throws APIManagerIntegrationTestExceptionGet api which are published- Returns:
- - http response of get API post request
- Throws:
APIManagerIntegrationTestException- - throws if API information retrieval fails.
-
getSession
public String getSession()
Get the current session cookies- Returns:
- current Cookie
-
generateUserAccessKey
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse generateUserAccessKey(String consumeKey, String consumerSecret, String messageBody, URL tokenEndpointURL) throws APIManagerIntegrationTestException
Generate user access key- Parameters:
consumeKey- - consumer key of userconsumerSecret- - consumer secret keymessageBody- - message bodytokenEndpointURL- - token endpoint url- Returns:
- - http response of generate access token api call
- Throws:
APIManagerIntegrationTestException- - throws if generating APIM access token fails
-
getAllPublishedAPIs
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllPublishedAPIs() throws APIManagerIntegrationTestExceptionGet all published apis- Returns:
- - http response of get all published apis
- Throws:
APIManagerIntegrationTestException- - throws if getting publish APIs fails
-
getAllApplications
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllApplications() throws APIManagerIntegrationTestExceptionGet all the applications- Returns:
- - http response of get get all applications
- Throws:
APIManagerIntegrationTestException- - throws if get all application fails.
-
getApplicationById
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getApplicationById(int applicationId) throws APIManagerIntegrationTestExceptionGet application by ID- Returns:
- - http response of get of application
- Throws:
APIManagerIntegrationTestException- - throws if get application fails.
-
getPublishedAPIsByApplication
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getPublishedAPIsByApplication(String applicationName) throws APIManagerIntegrationTestException
Get application details by given name- Parameters:
applicationName- - application name- Returns:
- - http response of get application request
- Throws:
APIManagerIntegrationTestException- - throws if get application by name fails
-
getPublishedAPIsByApplicationId
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getPublishedAPIsByApplicationId(String applicationName, int applicationId) throws APIManagerIntegrationTestException
Get application details by given name- Parameters:
applicationName- - application name- Returns:
- - http response of get application request
- Throws:
APIManagerIntegrationTestException- - throws if get application by name fails
-
addRatingToAPI
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addRatingToAPI(String apiName, String version, String provider, String rating) throws APIManagerIntegrationTestException
Add rating into api- Parameters:
apiName- - name of apiversion- - api versionprovider- - provider of apirating- - api rating- Returns:
- - http response of add rating request
- Throws:
APIManagerIntegrationTestException- - throws if rating of api fails
-
removeRatingFromAPI
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeRatingFromAPI(String apiName, String version, String provider) throws APIManagerIntegrationTestException
Remove rating of given API- Parameters:
apiName- - name of apiversion- - api versionprovider- - provider of api- Returns:
- - http response of remove rating request
- Throws:
APIManagerIntegrationTestException- - Throws if remove API rating fails
-
isRatingActivated
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse isRatingActivated() throws APIManagerIntegrationTestExceptionCheck if API rating activated- Returns:
- - http response of rating activated request
- Throws:
APIManagerIntegrationTestException- - Throws if rating status cannot be retrieved
-
getAllDocumentationOfAPI
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllDocumentationOfAPI(String apiName, String version, String provider) throws APIManagerIntegrationTestException
Method to retrieve all documents of given api- Parameters:
apiName- - name of apiversion- - api versionprovider- - provider of api- Returns:
- - http response of get all documentation of APIs
- Throws:
APIManagerIntegrationTestException- - throws if retrieval of API documentation fails
-
getApiEndpointUrls
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getApiEndpointUrls(String apiName, String version, String provider) throws APIManagerIntegrationTestException
Method to retrieve all endpoint urls
-
getAllPaginatedPublishedAPIs
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllPaginatedPublishedAPIs(String tenant, String start, String end) throws APIManagerIntegrationTestException
Get all paginated published API for a given tenant- Parameters:
tenant- - tenant namestart- - starting indexend- - closing index- Returns:
- - http response of paginated published APIs
- Throws:
APIManagerIntegrationTestException- - throws if paginated apis cannot be retrieved.
-
cleanUpApplicationRegistrationByApplicationId
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse cleanUpApplicationRegistrationByApplicationId(int applicationId, String applicationName) throws APIManagerIntegrationTestExceptionClean up application registration by ID- Parameters:
applicationId- - application IDapplicationName- - application name- Returns:
- - http response of paginated published APIs
- Throws:
APIManagerIntegrationTestException- - throws if paginated apis cannot be retrieved.
-
getAllPaginatedPublishedAPIs
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllPaginatedPublishedAPIs(String tenant, int start, int end) throws APIManagerIntegrationTestException
Gell all paginated published apis for a given tenant- Parameters:
tenant- - tenant namestart- - starting indexend- - ending index- Throws:
APIManagerIntegrationTestException
-
getAllPublishedAPIs
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllPublishedAPIs(String tenant) throws APIManagerIntegrationTestException
Get all published APIs for tenant- Parameters:
tenant- - tenant name- Returns:
- - http response of published API
- Throws:
APIManagerIntegrationTestException- - throws if published API retrieval fails.
-
addApplication
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addApplication(String application, String tier, String callbackUrl, String description) throws APIManagerIntegrationTestException
Add application- Parameters:
application- - application nametier- - throttling tiercallbackUrl- - callback urldescription- - description of app- Returns:
- - http response of add application
- Throws:
APIManagerIntegrationTestException- - if fails to add application
-
addApplicationWithGroup
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addApplicationWithGroup(String application, String tier, String callbackUrl, String description, String groupId) throws APIManagerIntegrationTestException
Add application with Group- Parameters:
application- - application nametier- - throttling tiercallbackUrl- - callback urldescription- - description of appgroupId- - group to share- Returns:
- - http response of add application
- Throws:
APIManagerIntegrationTestException- - if fails to add application
-
addApplicationWithTokenType
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addApplicationWithTokenType(String application, String tier, String callbackUrl, String description, String tokenType) throws APIManagerIntegrationTestException
Add application with token type- Parameters:
application- - application nametier- - throttling tiercallbackUrl- - callback urldescription- - description of apptokenType- - token type of app (JWT ot DEFAULT)- Returns:
- - http response of add application
- Throws:
APIManagerIntegrationTestException- - if fails to add application
-
getApplications
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getApplications() throws APIManagerIntegrationTestExceptionGet application- Returns:
- - http response of get applications
- Throws:
APIManagerIntegrationTestException- - throws if applications cannot be retrieved.
-
removeApplication
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeApplication(String application) throws APIManagerIntegrationTestException
Delete application- Parameters:
application- - application name- Returns:
- - http response of remove application request
- Throws:
APIManagerIntegrationTestException- - throws if remove application fails
-
removeApplicationById
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeApplicationById(int applicationId) throws APIManagerIntegrationTestExceptionDelete application by Id- Parameters:
applicationId- - application Id- Returns:
- - http response of remove application request
- Throws:
APIManagerIntegrationTestException- - throws if remove application fails
-
updateApplication
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateApplication(String applicationOld, String applicationNew, String callbackUrlNew, String descriptionNew, String tier) throws APIManagerIntegrationTestException
Update given application- Parameters:
applicationOld- - application name oldapplicationNew- - new application namecallbackUrlNew- - call back urldescriptionNew- - updated descriptiontier- - access tier- Returns:
- - http response of update application
- Throws:
APIManagerIntegrationTestException- - throws if update application fails
-
updateApplicationById
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateApplicationById(int applicationId, String applicationOld, String applicationNew, String callbackUrlNew, String descriptionNew, String tier) throws APIManagerIntegrationTestExceptionUpdate given application- Parameters:
applicationOld- - application name oldapplicationNew- - new application namecallbackUrlNew- - call back urldescriptionNew- - updated descriptiontier- - access tier- Returns:
- - http response of update application
- Throws:
APIManagerIntegrationTestException- - throws if update application fails
-
updateClientApplication
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateClientApplication(String application, String keyType, String authorizedDomains, String retryAfterFailure, String jsonParams, String callbackUrl) throws APIManagerIntegrationTestException
Update given Auth application- Parameters:
application- auth application namekeyType- type of the keyauthorizedDomains- authorized domainsretryAfterFailure- retry after failjsonParams- json parameters for grant typecallbackUrl- call back url- Returns:
- Http response of the update request
- Throws:
APIManagerIntegrationTestException- APIManagerIntegrationTestException - throws if update application fail
-
updateClientApplicationById
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateClientApplicationById(int applicationId, String application, String keyType, String authorizedDomains, String retryAfterFailure, String jsonParams, String callbackUrl) throws APIManagerIntegrationTestExceptionUpdate given Auth application- Parameters:
application- auth application namekeyType- type of the keyauthorizedDomains- authorized domainsretryAfterFailure- retry after failjsonParams- json parameters for grant typecallbackUrl- call back url- Returns:
- Http response of the update request
- Throws:
APIManagerIntegrationTestException- APIManagerIntegrationTestException - throws if update application fail
-
regenerateConsumerSecret
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse regenerateConsumerSecret(String clientId) throws APIManagerIntegrationTestException
Regenerate consumer secret.- Parameters:
clientId- Consumer Key of an application for which consumer secret need to be regenerate.- Returns:
- Regenerated consumer secret.
- Throws:
APIManagerIntegrationTestException- Throws if regeneration of consumer secret fail.
-
getAllSubscriptions
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllSubscriptions() throws APIManagerIntegrationTestExceptionGet all subscriptions- Returns:
- - http response of get all subscription request
- Throws:
APIManagerIntegrationTestException- - throws if get all subscriptions fails
-
getAllSubscriptionsOfApplication
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllSubscriptionsOfApplication() throws APIManagerIntegrationTestExceptionGet all subscriptions of Application. This is a method to get the subscription of a given application. As there is no application name is given, then only the subscriptions of first applications are returned.- Returns:
- - http response of get all subscription request
- Throws:
APIManagerIntegrationTestException- - throws if get all subscriptions fails
-
getAllSubscriptionsOfApplication
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllSubscriptionsOfApplication(String selectedApplication) throws APIManagerIntegrationTestException
Get all subscriptions of Application. This is a method to get the subscription of a given application. If no application name is given, then only the subscriptions of first applications are returned.- Returns:
- - http response of get all subscription request
- Throws:
APIManagerIntegrationTestException- - throws if get all subscriptions fails
-
getSubscribedAPIs
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getSubscribedAPIs(String applicationName) throws APIManagerIntegrationTestException
Get subscribed Apis by application name- Parameters:
applicationName- - Application Name- Throws:
APIManagerIntegrationTestException
-
getSubscribedAPIs
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getSubscribedAPIs(String applicationName, String domain) throws APIManagerIntegrationTestException
Get subscribed APIs for the specific Application- Parameters:
applicationName- - Name of the Application of API in store- Returns:
- - HttpResponse - Response with subscribed APIs
- Throws:
APIManagerIntegrationTestException
-
removeAPISubscription
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeAPISubscription(String API, String version, String provider, String applicationId) throws APIManagerIntegrationTestException
Unsubscribe from API- Parameters:
API- - name of apiversion- - api versionprovider- - provider nameapplicationId- - application id- Returns:
- - http response of unsubscription request
- Throws:
APIManagerIntegrationTestException- - Throws if unsubscription fails
-
removeAPISubscriptionByApplicationName
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeAPISubscriptionByApplicationName(String API, String version, String provider, String applicationName) throws APIManagerIntegrationTestException
Unsubscribe from API by application name- Parameters:
API- - name of apiversion- - api versionprovider- - provider nameapplicationName- - application Name- Returns:
- - http response of unsubscription request
- Throws:
APIManagerIntegrationTestException- - Throws if unsubscription fails
-
removeAPISubscriptionByName
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeAPISubscriptionByName(String API, String version, String provider, String appName) throws APIManagerIntegrationTestException
Unsubscribe from API- Parameters:
API- - name of apiversion- - api versionprovider- - provider nameappName- - application name- Returns:
- - http response of unsubscription request
- Throws:
APIManagerIntegrationTestException- - Throws if unsubscription fails
-
getAllTags
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllTags() throws APIManagerIntegrationTestExceptionGet all API tags- Returns:
- - http response of get all api tags
- Throws:
APIManagerIntegrationTestException- - throws if get all tags fails
-
addComment
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addComment(String apiName, String version, String provider, String comment) throws APIManagerIntegrationTestException
Add comment to given API- Parameters:
apiName- - name of the apiversion- - api versionprovider- - provider namecomment- - comment to add- Returns:
- - http response of add comment
- Throws:
APIManagerIntegrationTestException- - throws if add comment fails
-
isCommentActivated
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse isCommentActivated() throws APIManagerIntegrationTestExceptionCheck whether commenting is enabled- Returns:
- - http response of comment status
- Throws:
APIManagerIntegrationTestException- - Throws if retrieving comment activation status fails.
-
getRecentlyAddedAPIs
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getRecentlyAddedAPIs(String tenant, String limit) throws APIManagerIntegrationTestException
Get recently added APIs by tenant- Parameters:
tenant- - tenant namelimit- - limit of result set- Returns:
- - http response of recently added API request
- Throws:
APIManagerIntegrationTestException- - throws if
-
getAPIPageFilteredWithTags
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPIPageFilteredWithTags(String apiTag) throws APIManagerIntegrationTestException
Get the web page with filtered API when click the API Tag link- Parameters:
apiTag- - API tag the need ti filter the api.- Returns:
- HttpResponse - Response that contains the web page with filtered API when click the API Tag link
- Throws:
APIManagerIntegrationTestException- - Exception throws when check the Authentication and HTTPSClientUtils.sendGetRequest() method call
-
subscribeToAPI
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse subscribeToAPI(SubscriptionRequest subscriptionRequest) throws APIManagerIntegrationTestException
Subscribe and API. This method return the response of the subscription server REST call.- Parameters:
subscriptionRequest- -SubscriptionRequest request instance with API subscription information.- Returns:
- HttpResponse - Response f the subscription server REST call
- Throws:
APIManagerIntegrationTestException- - Exception throws when check the Authentication and HTTPSClientUtils.doPost() method call.
-
getAPIListFromStoreAsAnonymousUser
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPIListFromStoreAsAnonymousUser(String tenantDomain) throws APIManagerIntegrationTestException
-
logout
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse logout() throws APIManagerIntegrationTestExceptionAPI Store logout
-
signUp
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse signUp(String userName, String password, String firstName, String lastName, String email) throws APIManagerIntegrationTestException
API Store sign up- Parameters:
userName- - store user namepassword- -store passwordfirstName- - user first namelastName- - user's last nameemail- - user's email- Returns:
- Throws:
APIManagerIntegrationTestException
-
signUpforTenant
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse signUpforTenant(String userName, String password, String claims) throws APIManagerIntegrationTestException
API Store sign up- Parameters:
userName- - store user namepassword- -store passwordclaims- - tenants claims- Returns:
- Throws:
APIManagerIntegrationTestException
-
signUpWithOrganization
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse signUpWithOrganization(String userName, String password, String firstName, String lastName, String email, String organization) throws APIManagerIntegrationTestException
API Store sign up with organization- Parameters:
userName- - store user namepassword- -store passwordfirstName- - user first namelastName- - user's last nameemail- - user's emailorganization- - user's organization- Returns:
- Throws:
APIManagerIntegrationTestException
-
getPrototypedAPI
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getPrototypedAPI(String tenant) throws APIManagerIntegrationTestException
Get Prototyped APIs in Store- Returns:
- HttpResponse - Response with APIs which are deployed as a Prototyped APIs
- Throws:
APIManagerIntegrationTestException
-
searchPaginateAPIs
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse searchPaginateAPIs(String tenant, String start, String end, String searchTerm) throws Exception
- Throws:
Exception
-
waitForSwaggerDocument
public void waitForSwaggerDocument(String userName, String apiName, String apiVersion, String expectedResponse, String executionMode) throws IOException, XPathExpressionException
Wait for swagger document until its updated.- Parameters:
userName- - Name of the api providerapiName- - API NameapiVersion- - API VersionexpectedResponse- - Expected response of the APIexecutionMode- - Mode of the test execution (Standalone or Platform)- Throws:
IOException- - Throws if Swagger document cannot be foundXPathExpressionException- - Throws if Swagger document cannot be found
-
getSwaggerDocument
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getSwaggerDocument(String userName, String apiName, String apiVersion, String executionMode) throws APIManagerIntegrationTestException
This method will return swagger document of given api name and version- Parameters:
userName- - User who request the swagger documentapiName- - Name of the APIapiVersion- - Version of the APIexecutionMode- - Mode of the test execution (Standalone or Platform)- Returns:
- - HTTP Response of the GET swagger document request
- Throws:
APIManagerIntegrationTestException- - Throws if swagger document GET request fails
-
getApplicationPage
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getApplicationPage() throws APIManagerIntegrationTestExceptionGet application page- Returns:
- - http response of get application
- Throws:
APIManagerIntegrationTestException- - if fails to get application page
-
generateSDKUpdated
public org.apache.http.HttpResponse generateSDKUpdated(String sdkLanguage, String apiName, String apiVersion, String apiProvider, String tenant) throws APIManagerIntegrationTestException
Generate SDK for a given programming language- Parameters:
sdkLanguage- programming language for the SDKapiName- name of the APIapiVersion- version of the APIapiProvider- provider of the API- Returns:
- org.apache.http.HttpResponse for the SDK generation
- Throws:
APIManagerIntegrationTestException- if failed to generate the SDK
-
changePassword
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse changePassword(String username, String currentPassword, String newPassword) throws APIManagerIntegrationTestException
Change password of the user- Parameters:
username- username of the usercurrentPassword- current password of the usernewPassword- new password of the user- Returns:
- Throws:
APIManagerIntegrationTestException- if failed to change password
-
addApplicationWithCustomAttributes
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addApplicationWithCustomAttributes(String application, String tier, String callbackUrl, String description, String applicationAttributes) throws APIManagerIntegrationTestException
Add application with custom attributes- Parameters:
application- - application nametier- - throttling tiercallbackUrl- - callback urldescription- - description of appapplicationAttributes- - Json string of custom attributes defined by user- Returns:
- - http response of add application
- Throws:
APIManagerIntegrationTestException- - if fails to add application
-
-