public TestInfo stopInTheCloud(String userKey, TestInfo testInfo) {
        if (userKey == null || userKey.trim().isEmpty()) {
            BmLog.debug("Test cannot be stopped in the cloud, userKey is empty");
            return testInfo;
        }
        String url = this.urlManager.testStop(Constants.APP_KEY, userKey, testInfo.getId());
        JSONObject jo = getJson(Methods.POST, url, null);
        try {
            testInfo.setStatus(jo.getInt("response_code") == 200 ? TestStatus.NotRunning : TestStatus.Running);
        } catch (JSONException je) {
            BmLog.debug("Failed to set test status: " + je.getMessage());
        }
        return testInfo;
    }