@@ -232,24 +232,34 @@ public void testConnectionDoesNotGetClosed() throws Exception {
232232 .setHeader ("X-" + CONTENT_MD5 , expectedMd5 );
233233
234234 Response response = requestBuilder .execute ().get ();
235- assertEquals (response .getStatusCode (), 200 );
235+ assertEquals (response .getStatusCode (), 200 , "HTTP response was invalid on first request." );
236+
236237 byte [] responseBody = response .getResponseBodyAsBytes ();
237238 responseBody = response .getResponseBodyAsBytes ();
238- assertEquals (Integer .valueOf (response .getHeader ("X-" + CONTENT_LENGTH )).intValue (), LARGE_IMAGE_BYTES .length , "Server side payload length invalid" );
239+ assertEquals (
240+ Integer .valueOf (response .getHeader ("X-" + CONTENT_LENGTH )).intValue (),
241+ LARGE_IMAGE_BYTES .length ,
242+ "Server side payload length invalid"
243+ );
239244 assertEquals (responseBody .length , LARGE_IMAGE_BYTES .length , "Client side payload length invalid" );
240245 assertEquals (response .getHeader (CONTENT_MD5 ), expectedMd5 , "Server side payload MD5 invalid" );
241246 assertEquals (TestUtils .md5 (responseBody ), expectedMd5 , "Client side payload MD5 invalid" );
242- assertEquals (responseBody , LARGE_IMAGE_BYTES );
247+ assertEquals (responseBody , LARGE_IMAGE_BYTES , "Image bytes are not equal on first attempt" );
243248
244249 response = requestBuilder .execute ().get ();
245250 assertEquals (response .getStatusCode (), 200 );
246251 responseBody = response .getResponseBodyAsBytes ();
247- assertEquals (Integer .valueOf (response .getHeader ("X-" + CONTENT_LENGTH )).intValue (), LARGE_IMAGE_BYTES .length , "Server side payload length invalid" );
252+ assertEquals (
253+ Integer .valueOf (response .getHeader ("X-" + CONTENT_LENGTH )).intValue (),
254+ LARGE_IMAGE_BYTES .length ,
255+ "Server side payload length invalid"
256+ );
248257 assertEquals (responseBody .length , LARGE_IMAGE_BYTES .length , "Client side payload length invalid" );
258+
249259 try {
250260 assertEquals (response .getHeader (CONTENT_MD5 ), expectedMd5 , "Server side payload MD5 invalid" );
251261 assertEquals (TestUtils .md5 (responseBody ), expectedMd5 , "Client side payload MD5 invalid" );
252- assertEquals (responseBody , LARGE_IMAGE_BYTES );
262+ assertEquals (responseBody , LARGE_IMAGE_BYTES , "Image bytes weren't equal on subsequent test" );
253263 } catch (AssertionError e ) {
254264 e .printStackTrace ();
255265 for (int i = 0 ; i < LARGE_IMAGE_BYTES .length ; i ++) {
0 commit comments