@Test(expected = IOException.class) public void invalidCreateResponse() throws IOException { stubCreatedVersionResponse(500, VERSION_1_0); client.createVersion(VERSION_1_0); }
HockeyAppVersion createVersion(String version) throws IOException, JSONException { HttpPost request = requestBuilder.preparePostRequest(API_VERSIONS_NEW); List<NameValuePair> parameters = buildCreateParameters(version); request.setEntity(new UrlEncodedFormEntity(parameters, HTTP.UTF_8)); HttpResponse response = requestBuilder.getHttpClient().execute(request); if (response.getStatusLine().getStatusCode() != 201) { throw new IOException("Create version(" + API_VERSIONS_NEW + ") failed! Wrong status code"); } String responseContent = EntityUtils.toString(response.getEntity()); return parseVersionCreateResponse(responseContent); }
VersionClient { HockeyAppVersion createVersion(String version) throws IOException, JSONException { HttpPost request = requestBuilder.preparePostRequest(API_VERSIONS_NEW); List<NameValuePair> parameters = buildCreateParameters(version); request.setEntity(new UrlEncodedFormEntity(parameters, HTTP.UTF_8)); HttpResponse response = requestBuilder.getHttpClient().execute(request); if (response.getStatusLine().getStatusCode() != 201) { throw new IOException("Create version(" + API_VERSIONS_NEW + ") failed! Wrong status code"); } String responseContent = EntityUtils.toString(response.getEntity()); return parseVersionCreateResponse(responseContent); } }
VersionClient { HockeyAppVersion createVersion(String version) throws IOException, JSONException { HttpPost request = requestBuilder.preparePostRequest(API_VERSIONS_NEW); List<NameValuePair> parameters = buildCreateParameters(version); request.setEntity(new UrlEncodedFormEntity(parameters, HTTP.UTF_8)); HttpResponse response = requestBuilder.getHttpClient().execute(request); if (response.getStatusLine().getStatusCode() != 201) { throw new IOException("Create version(" + API_VERSIONS_NEW + ") failed! Wrong status code"); } String responseContent = EntityUtils.toString(response.getEntity()); return parseVersionCreateResponse(responseContent); } VersionClient(HockeyAppRequestBuilder requestBuilder); }
VersionClient { HockeyAppVersion createVersion(String version) throws IOException, JSONException { HttpPost request = requestBuilder.preparePostRequest(API_VERSIONS_NEW); List<NameValuePair> parameters = buildCreateParameters(version); request.setEntity(new UrlEncodedFormEntity(parameters, HTTP.UTF_8)); HttpResponse response = requestBuilder.getHttpClient().execute(request); if (response.getStatusLine().getStatusCode() != 201) { throw new IOException("Create version(" + API_VERSIONS_NEW + ") failed! Wrong status code"); } String responseContent = EntityUtils.toString(response.getEntity()); return parseVersionCreateResponse(responseContent); } VersionClient(HockeyAppRequestBuilder requestBuilder); HockeyAppVersion getVersion(); }
VersionClient { HockeyAppVersion createVersion(String version) throws IOException, JSONException { HttpPost request = requestBuilder.preparePostRequest(API_VERSIONS_NEW); List<NameValuePair> parameters = buildCreateParameters(version); request.setEntity(new UrlEncodedFormEntity(parameters, HTTP.UTF_8)); HttpResponse response = requestBuilder.getHttpClient().execute(request); if (response.getStatusLine().getStatusCode() != 201) { throw new IOException("Create version(" + API_VERSIONS_NEW + ") failed! Wrong status code"); } String responseContent = EntityUtils.toString(response.getEntity()); return parseVersionCreateResponse(responseContent); } VersionClient(HockeyAppRequestBuilder requestBuilder); HockeyAppVersion getVersion();  }