public void connectToServer() throws HttpClientException {
        String connectionTestResponse;
        try {
            connectionTestResponse = sendRequestToServer(CONNECTION_TEST_MESSAGE);
        } catch (HttpClientException e) {
            throw new HttpClientException("Connection to server failed", e);
        }

        if (!CONNECTION_SUCCESS_MESSAGE.equals(connectionTestResponse)) {
            throw new HttpClientException("Connection to server failed");
        }
    }