@Test public void asResponseString_newStringThrowsException_shouldReturnNull() throws Exception { when(downloadResponse1.getByteArray()).thenReturn(null); assertThat(HttpResponses.asResponseString(downloadResponse1)).isNull(); }
public static String asResponseString(final DownloadResponse downloadResponse) { if (downloadResponse == null) { return null; } try { return new String(downloadResponse.getByteArray(), "UTF-8"); } catch (Exception e) { return null; } }
HttpResponses { public static String asResponseString(final DownloadResponse downloadResponse) { if (downloadResponse == null) { return null; } try { return new String(downloadResponse.getByteArray(), "UTF-8"); } catch (Exception e) { return null; } } }
HttpResponses { public static String asResponseString(final DownloadResponse downloadResponse) { if (downloadResponse == null) { return null; } try { return new String(downloadResponse.getByteArray(), "UTF-8"); } catch (Exception e) { return null; } } private  HttpResponses(); }
HttpResponses { public static String asResponseString(final DownloadResponse downloadResponse) { if (downloadResponse == null) { return null; } try { return new String(downloadResponse.getByteArray(), "UTF-8"); } catch (Exception e) { return null; } } private  HttpResponses(); static Bitmap asBitmap(final DownloadResponse downloadResponse); static JSONObject asJsonObject(final DownloadResponse downloadResponse); static String asResponseString(final DownloadResponse downloadResponse); }
HttpResponses { public static String asResponseString(final DownloadResponse downloadResponse) { if (downloadResponse == null) { return null; } try { return new String(downloadResponse.getByteArray(), "UTF-8"); } catch (Exception e) { return null; } } private  HttpResponses(); static Bitmap asBitmap(final DownloadResponse downloadResponse); static JSONObject asJsonObject(final DownloadResponse downloadResponse); static String asResponseString(final DownloadResponse downloadResponse);  }