Class ApiTestHelper
java.lang.Object
org.wso2.am.integration.test.impl.ApiTestHelper
-
Constructor Summary
ConstructorsConstructorDescriptionApiTestHelper(RestAPIPublisherImpl restAPIPublisher, RestAPIStoreImpl restAPIStore, String resourceLocation, String tenantDomain, String keyManagerUrl, org.wso2.carbon.automation.engine.context.beans.User user) -
Method Summary
Modifier and TypeMethodDescriptioncreateAdvertiseOnlyApi(String backendUrl) createAnApi(String backendUrl) createApiOne(String backendUrl) createApiTwo(String backendUrl) createRestrictedAccessControlApi(String backendUrl, String role) createScopeProtectedApi(String backendUrl, String role, String scope) generateTokenPasswordGrant(String consumerKey, String consumerSecret, String userName, String password, List<String> scopes) voidverifyInvocation(APIDTO apiDTO, String productionAccessToken, String sandboxAccessToken, InvocationStatusCodes expectedStatus) voidverifyInvocation(APIDTO apiDTO, String productionAccessToken, String sandboxAccessToken, InvocationStatusCodes expectedStatus, String requestBody, String expectedResponse, Map<String, String> headers) verifyKeyGeneration(ApplicationDTO applicationDTO, ApplicationKeyGenerateRequestDTO.KeyTypeEnum keyType, ArrayList<String> scopes, List<String> grantTypes) verifySubscription(APIDTO apiDTO, String applicationName, String subscriptionPolicy)
-
Constructor Details
-
ApiTestHelper
public ApiTestHelper(RestAPIPublisherImpl restAPIPublisher, RestAPIStoreImpl restAPIStore, String resourceLocation, String tenantDomain, String keyManagerUrl, org.wso2.carbon.automation.engine.context.beans.User user)
-
-
Method Details
-
createApiOne
- Throws:
ApiException
-
createApiTwo
- Throws:
ApiException
-
createRestrictedAccessControlApi
- Throws:
ApiException
-
createScopeProtectedApi
public APIDTO createScopeProtectedApi(String backendUrl, String role, String scope) throws ApiException, IOException - Throws:
ApiExceptionIOException
-
createAnApi
- Throws:
IOExceptionApiException
-
createAdvertiseOnlyApi
- Throws:
ApiException
-
verifySubscription
public ApplicationDTO verifySubscription(APIDTO apiDTO, String applicationName, String subscriptionPolicy) throws ApiException, APIManagerIntegrationTestException -
verifyKeyGeneration
public ApplicationKeyDTO verifyKeyGeneration(ApplicationDTO applicationDTO, ApplicationKeyGenerateRequestDTO.KeyTypeEnum keyType, ArrayList<String> scopes, List<String> grantTypes) throws ApiException, APIManagerIntegrationTestException -
generateTokenPasswordGrant
public String generateTokenPasswordGrant(String consumerKey, String consumerSecret, String userName, String password, List<String> scopes) throws APIManagerIntegrationTestException, MalformedURLException -
verifyInvocation
public void verifyInvocation(APIDTO apiDTO, String productionAccessToken, String sandboxAccessToken, InvocationStatusCodes expectedStatus) throws IOException - Throws:
IOException
-
verifyInvocation
public void verifyInvocation(APIDTO apiDTO, String productionAccessToken, String sandboxAccessToken, InvocationStatusCodes expectedStatus, String requestBody, String expectedResponse, Map<String, String> headers) throws IOException- Throws:
IOException
-