@BeforeClass(alwaysRun = true)
  public void setEnvironment() throws Exception {

    super.init(userMode);
    String publisherURLHttp = publisherUrls.getWebAppURLHttp();
    String storeURLHttp = storeUrls.getWebAppURLHttp();

    apiStore = new APIStoreRestClient(storeURLHttp);
    APIPublisherRestClient apiPublisher = new APIPublisherRestClient(publisherURLHttp);

    String APIName = "APIGetAllSubscriptionsTestAPI";
    String APIContext = "getAllSubscriptionsTestAPI";
    String tags = "youtube, video, media";
    String url = "http://gdata.youtube.com/feeds/api/standardfeeds";
    String description = "This is test API create by API manager integration test";
    String providerName = "admin";
    String APIVersion = "1.0.0";

    apiPublisher.login(
        publisherContext.getContextTenant().getContextUser().getUserName(),
        publisherContext.getContextTenant().getContextUser().getPassword());
    APIRequest apiRequest = new APIRequest(APIName, APIContext, new URL(url));
    apiRequest.setTags(tags);
    apiRequest.setDescription(description);
    apiRequest.setVersion(APIVersion);
    apiRequest.setVisibility("restricted");
    apiRequest.setRoles("admin");

    apiRequest.setTiersCollection(SILVER);
    apiRequest.setTier(SILVER);

    apiPublisher.addAPI(apiRequest);
    APILifeCycleStateRequest updateRequest =
        new APILifeCycleStateRequest(APIName, providerName, APILifeCycleState.PUBLISHED);
    apiPublisher.changeAPILifeCycleStatus(updateRequest);

    apiStore.login(
        storeContext.getContextTenant().getContextUser().getUserName(),
        storeContext.getContextTenant().getContextUser().getPassword());

    for (int i = 0; i < numberOfApplications; i++) {
      String applicationName = applicationNamePrefix + i;
      apiStore.addApplication(
          applicationName,
          APIMIntegrationConstants.APPLICATION_TIER.DEFAULT_APP_POLICY_FIFTY_REQ_PER_MIN,
          "",
          "this-is-test");

      SubscriptionRequest subscriptionRequest =
          new SubscriptionRequest(
              APIName, storeContext.getContextTenant().getContextUser().getUserName());
      subscriptionRequest.setApplicationName(applicationName);
      subscriptionRequest.setTier(SILVER);
      apiStore.subscribe(subscriptionRequest);

      APPKeyRequestGenerator generateAppKeyRequest = new APPKeyRequestGenerator(applicationName);
      String responseString = apiStore.generateApplicationKey(generateAppKeyRequest).getData();

      JSONObject response = new JSONObject(responseString);
      String error = response.getString("error");
      if ("true".equals(error)) {
        throw new Exception("Unable to generate the tokens. Hence unable to execute the test case");
      }
    }
    Thread.sleep(60000);
  }