Skip to content

Commit 36028c2

Browse files
committed
Java formatting
1 parent 3d91fd9 commit 36028c2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

firebase-appdistribution/src/test/java/com/google/firebase/appdistribution/impl/TesterApiHttpClientTest.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ public void setup() throws Exception {
8282
@Test
8383
public void makeGetRequest_whenResponseSuccessful_returnsJsonResponse() throws Exception {
8484
String responseJson = readTestFile("testSimpleResponse.json");
85-
InputStream responseInputStream =
86-
new ByteArrayInputStream(responseJson.getBytes(UTF_8));
85+
InputStream responseInputStream = new ByteArrayInputStream(responseJson.getBytes(UTF_8));
8786
when(mockHttpsURLConnection.getResponseCode()).thenReturn(200);
8887
when(mockHttpsURLConnection.getInputStream()).thenReturn(responseInputStream);
8988

@@ -111,8 +110,7 @@ public void makeGetRequest_whenConnectionFails_throwsError() throws Exception {
111110

112111
@Test
113112
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));
116114
when(mockHttpsURLConnection.getInputStream()).thenReturn(response);
117115
when(mockHttpsURLConnection.getResponseCode()).thenReturn(200);
118116

@@ -194,8 +192,7 @@ public void makeGetRequest_whenResponseFailsWithUnknownCode_throwsError() throws
194192
@Test
195193
public void makePostRequest_zipsRequestBodyAndSetsCorrectHeaders() throws Exception {
196194
String responseJson = readTestFile("testSimpleResponse.json");
197-
InputStream responseInputStream =
198-
new ByteArrayInputStream(responseJson.getBytes(UTF_8));
195+
InputStream responseInputStream = new ByteArrayInputStream(responseJson.getBytes(UTF_8));
199196
when(mockHttpsURLConnection.getResponseCode()).thenReturn(200);
200197
when(mockHttpsURLConnection.getInputStream()).thenReturn(responseInputStream);
201198
ByteArrayOutputStream requestBodyOutputStream = new ByteArrayOutputStream();
@@ -222,7 +219,9 @@ public void makePostRequest_whenConnectionFails_throwsError() throws Exception {
222219
FirebaseAppDistributionException e =
223220
assertThrows(
224221
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));
226225

227226
assertThat(e.getErrorCode()).isEqualTo(Status.NETWORK_FAILURE);
228227
assertThat(e.getMessage()).contains(TAG);
@@ -232,14 +231,14 @@ public void makePostRequest_whenConnectionFails_throwsError() throws Exception {
232231
@Test
233232
public void makeUploadRequest_zipsRequestBodyAndSetsCorrectHeaders() throws Exception {
234233
String responseJson = readTestFile("testSimpleResponse.json");
235-
InputStream responseInputStream =
236-
new ByteArrayInputStream(responseJson.getBytes(UTF_8));
234+
InputStream responseInputStream = new ByteArrayInputStream(responseJson.getBytes(UTF_8));
237235
when(mockHttpsURLConnection.getResponseCode()).thenReturn(200);
238236
when(mockHttpsURLConnection.getInputStream()).thenReturn(responseInputStream);
239237
ByteArrayOutputStream requestBodyOutputStream = new ByteArrayOutputStream();
240238
when(mockHttpsURLConnection.getOutputStream()).thenReturn(requestBodyOutputStream);
241239

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));
243242

244243
byte[] unzippedPostBody =
245244
ByteStreams.toByteArray(

0 commit comments

Comments
 (0)