public TestInfo updateTestSettings(String userKey, String testId, String location,
                                       int engines, String engineType, int usersPerEngine,
                                       int iterations, int rumpUp, int duration, Properties jmeterProperties) {
        TestInfo testInfo = new TestInfo();
        if (userKey == null || userKey.trim().isEmpty()) {
            BmLog.debug("Test settings cannot be updated, userKey is empty");
            return testInfo;
        }

        if (testId == null || testId.trim().isEmpty()) {
            BmLog.debug("Test settings cannot be updated, testId is empty");
            return testInfo;
        }

        String url = this.urlManager.testUpdateUrl(Constants.APP_KEY, userKey, testId);
        JSONObject obj = new JSONObject();
        try {
            JSONObject options = new JSONObject();
            options.put("NUMBER_OF_ENGINES", engines);//engine
            options.put("JMETER_VERSION", Utils.getJmeterVersion());//engine
            options.put("INSTANCE_TYPE", engineType);//engine
            options.put("OVERRIDE", 1);
            options.put("OVERRIDE_THREADS", usersPerEngine);//threads
            options.put("OVERRIDE_ITERATIONS", iterations);//iter
            options.put("OVERRIDE_RAMP_UP", rumpUp);//ranpup
            options.put("OVERRIDE_DURATION", duration);//duration
            options.put("LOCATION", location);
            // pass Properties jmeterProperties to method;
            JSONObject jmeter_params = Utils.convertToJSON(jmeterProperties);
            options.put("JMETER_PARAMS", jmeter_params);

            obj.put("options", options);
            JSONObject jo = getJson(Methods.POST, url, obj);
            if (jo == null || jo.getInt("response_code") != 200) {
                BmLog.error("Failed to update: " + testId);
                BmLog.error("JSON options were sent with JSON object: " + options.toString());
                BmLog.error("UserKey = " + userKey);
                BmLog.error("Test id = " + userKey);
                BmLog.error("LOCATION = " + location);

            } else if (jo.getInt("response_code") == 200) {
                testInfo = TestInfoProcessor.parseTestInfo(jo);
            }
        } catch (JSONException e) {
            BmLog.error(e);
        } catch (NullPointerException npe) {
            BmLog.error("Invalid answer from server! Turn to customer support to resolve issue. See log for details: " + npe);
        } finally {
            return testInfo;
        }
    }