Class ApiTestHelper
- java.lang.Object
-
- org.wso2.am.integration.test.impl.ApiTestHelper
-
public class ApiTestHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description ApiTestHelper(RestAPIPublisherImpl restAPIPublisher, RestAPIStoreImpl restAPIStore, String resourceLocation, String tenantDomain, String keyManagerUrl, org.wso2.carbon.automation.engine.context.beans.User user)
-
Method Summary
-
-
-
Constructor Detail
-
ApiTestHelper
public ApiTestHelper(RestAPIPublisherImpl restAPIPublisher, RestAPIStoreImpl restAPIStore, String resourceLocation, String tenantDomain, String keyManagerUrl, org.wso2.carbon.automation.engine.context.beans.User user)
-
-
Method Detail
-
createApiOne
public APIDTO createApiOne(String backendUrl) throws ApiException
- Throws:
ApiException
-
createApiTwo
public APIDTO createApiTwo(String backendUrl) throws ApiException
- Throws:
ApiException
-
createRestrictedAccessControlApi
public APIDTO createRestrictedAccessControlApi(String backendUrl, String role) throws ApiException
- Throws:
ApiException
-
createScopeProtectedApi
public APIDTO createScopeProtectedApi(String backendUrl, String role, String scope) throws ApiException, IOException
- Throws:
ApiExceptionIOException
-
createAnApi
public APIDTO createAnApi(String backendUrl) throws IOException, ApiException
- Throws:
IOExceptionApiException
-
createAdvertiseOnlyApi
public APIDTO createAdvertiseOnlyApi(String backendUrl) throws ApiException
- 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
-
-