Source:
<code>public void init() throws Exception { apiStore = new APIStoreRestClient(storeURL); apiPublisher = new APIPublisherRestClient(publisherURL); createUserWithSubscriberRole(SUBSCRIBER_USERNAME, SUBSCRIBER_PASSWORD, ADMIN_LOGIN_USERNAME, ADMIN_PASSWORD); createUserWithPublisherAndCreatorRole(API_DEVELOPER_USERNAME, API_DEVELOPER_PASSWORD, ADMIN_LOGIN_USERNAME, ADMIN_PASSWORD); apiStore.login(SUBSCRIBER_USERNAME, SUBSCRIBER_PASSWORD); apiPublisher.login(API_DEVELOPER_USERNAME, API_DEVELOPER_PASSWORD); String swaggerFilePath = System.getProperty("framework.resource.location") + "swaggerFiles" + File.separator + "phoneverify-swagger.json"; File swaggerFile = new File(swaggerFilePath); String swaggerContent = readFromFile(swaggerFile.getAbsolutePath()); JSONObject swaggerJson = new JSONObject(swaggerContent); apiPublisher.developSampleAPI(swaggerJson, API_DEVELOPER_USERNAME, backendEndPoint, true, "public"); createApplication(TEST_APPLICATION_NAME); isAPIVisibleInStore(TEST_API_1_NAME, apiStore); SubscriptionRequest subscriptionRequest = new SubscriptionRequest(TEST_API_1_NAME, TEST_API_1_VERSION, API_DEVELOPER_USERNAME, TEST_APPLICATION_NAME, APIMIntegrationConstants.APPLICATION_TIER.UNLIMITED); HttpResponse addSubscriptionResponse = apiStore.subscribe(subscriptionRequest); verifyResponse(addSubscriptionResponse); log.info(TEST_APPLICATION_NAME + " is subscribed to " + TEST_API_1_NAME); <START> accessToken = generateAppKeys(); <END> }</code><technical_language>generateAppKeys() method basically returns access token client credentials grant type. need transferred test method (testOAuth2Authorization) other test cases needed obtain valid token client credentials password grant types</technical_language>

Target:
public void init() throws Exception { apiStore = new APIStoreRestClient(storeURL); apiPublisher = new APIPublisherRestClient(publisherURL); createUserWithSubscriberRole(SUBSCRIBER_USERNAME, SUBSCRIBER_PASSWORD, ADMIN_LOGIN_USERNAME, ADMIN_PASSWORD); createUserWithPublisherAndCreatorRole(API_DEVELOPER_USERNAME, API_DEVELOPER_PASSWORD, ADMIN_LOGIN_USERNAME, ADMIN_PASSWORD); apiStore.login(SUBSCRIBER_USERNAME, SUBSCRIBER_PASSWORD); apiPublisher.login(API_DEVELOPER_USERNAME, API_DEVELOPER_PASSWORD); String swaggerFilePath = System.getProperty("framework.resource.location") + "swaggerFiles" + File.separator + "phoneverify-swagger.json"; File swaggerFile = new File(swaggerFilePath); String swaggerContent = readFromFile(swaggerFile.getAbsolutePath()); JSONObject swaggerJson = new JSONObject(swaggerContent); apiPublisher.developSampleAPI(swaggerJson, API_DEVELOPER_USERNAME, backendEndPoint, true, "public"); createApplication(TEST_APPLICATION_NAME); isAPIVisibleInStore(TEST_API_1_NAME, apiStore); SubscriptionRequest subscriptionRequest = new SubscriptionRequest(TEST_API_1_NAME, TEST_API_1_VERSION, API_DEVELOPER_USERNAME, TEST_APPLICATION_NAME, APIMIntegrationConstants.APPLICATION_TIER.UNLIMITED); HttpResponse addSubscriptionResponse = apiStore.subscribe(subscriptionRequest); verifyResponse(addSubscriptionResponse); if (log.isDebugEnabled()) { log.debug(TEST_APPLICATION_NAME + " is subscribed to " + TEST_API_1_NAME); } accessToken = generateAppKeys(); }