@@ -82,8 +82,7 @@ public void setup() throws Exception {
82
82
@ Test
83
83
public void makeGetRequest_whenResponseSuccessful_returnsJsonResponse () throws Exception {
84
84
String responseJson = readTestFile ("testSimpleResponse.json" );
85
- InputStream responseInputStream =
86
- new ByteArrayInputStream (responseJson .getBytes (UTF_8 ));
85
+ InputStream responseInputStream = new ByteArrayInputStream (responseJson .getBytes (UTF_8 ));
87
86
when (mockHttpsURLConnection .getResponseCode ()).thenReturn (200 );
88
87
when (mockHttpsURLConnection .getInputStream ()).thenReturn (responseInputStream );
89
88
@@ -111,8 +110,7 @@ public void makeGetRequest_whenConnectionFails_throwsError() throws Exception {
111
110
112
111
@ Test
113
112
public void makeGetRequest_whenInvalidJson_throwsError () throws Exception {
114
- InputStream response =
115
- new ByteArrayInputStream (INVALID_RESPONSE .getBytes (UTF_8 ));
113
+ InputStream response = new ByteArrayInputStream (INVALID_RESPONSE .getBytes (UTF_8 ));
116
114
when (mockHttpsURLConnection .getInputStream ()).thenReturn (response );
117
115
when (mockHttpsURLConnection .getResponseCode ()).thenReturn (200 );
118
116
@@ -194,8 +192,7 @@ public void makeGetRequest_whenResponseFailsWithUnknownCode_throwsError() throws
194
192
@ Test
195
193
public void makePostRequest_zipsRequestBodyAndSetsCorrectHeaders () throws Exception {
196
194
String responseJson = readTestFile ("testSimpleResponse.json" );
197
- InputStream responseInputStream =
198
- new ByteArrayInputStream (responseJson .getBytes (UTF_8 ));
195
+ InputStream responseInputStream = new ByteArrayInputStream (responseJson .getBytes (UTF_8 ));
199
196
when (mockHttpsURLConnection .getResponseCode ()).thenReturn (200 );
200
197
when (mockHttpsURLConnection .getInputStream ()).thenReturn (responseInputStream );
201
198
ByteArrayOutputStream requestBodyOutputStream = new ByteArrayOutputStream ();
@@ -222,7 +219,9 @@ public void makePostRequest_whenConnectionFails_throwsError() throws Exception {
222
219
FirebaseAppDistributionException e =
223
220
assertThrows (
224
221
FirebaseAppDistributionException .class ,
225
- () -> testerApiHttpClient .makePostRequest (TAG , TEST_PATH , TEST_AUTH_TOKEN , TEST_POST_BODY ));
222
+ () ->
223
+ testerApiHttpClient .makePostRequest (
224
+ TAG , TEST_PATH , TEST_AUTH_TOKEN , TEST_POST_BODY ));
226
225
227
226
assertThat (e .getErrorCode ()).isEqualTo (Status .NETWORK_FAILURE );
228
227
assertThat (e .getMessage ()).contains (TAG );
@@ -232,14 +231,14 @@ public void makePostRequest_whenConnectionFails_throwsError() throws Exception {
232
231
@ Test
233
232
public void makeUploadRequest_zipsRequestBodyAndSetsCorrectHeaders () throws Exception {
234
233
String responseJson = readTestFile ("testSimpleResponse.json" );
235
- InputStream responseInputStream =
236
- new ByteArrayInputStream (responseJson .getBytes (UTF_8 ));
234
+ InputStream responseInputStream = new ByteArrayInputStream (responseJson .getBytes (UTF_8 ));
237
235
when (mockHttpsURLConnection .getResponseCode ()).thenReturn (200 );
238
236
when (mockHttpsURLConnection .getInputStream ()).thenReturn (responseInputStream );
239
237
ByteArrayOutputStream requestBodyOutputStream = new ByteArrayOutputStream ();
240
238
when (mockHttpsURLConnection .getOutputStream ()).thenReturn (requestBodyOutputStream );
241
239
242
- testerApiHttpClient .makeUploadRequest (TAG , TEST_PATH , TEST_AUTH_TOKEN , TEST_POST_BODY .getBytes (UTF_8 ));
240
+ testerApiHttpClient .makeUploadRequest (
241
+ TAG , TEST_PATH , TEST_AUTH_TOKEN , TEST_POST_BODY .getBytes (UTF_8 ));
243
242
244
243
byte [] unzippedPostBody =
245
244
ByteStreams .toByteArray (
0 commit comments