@Test public void testGetInputStream() throws IOException { String expectedContents = "a,b,c\nd,e,f\n"; InputStream inputStream = new ByteArrayInputStream(expectedContents.getBytes(UTF_8)); RawReportDownloadResponse rawResponse = new RawReportDownloadResponse(HttpURLConnection.HTTP_OK, inputStream, UTF_8, "CSV"); ReportDownloadResponse response = new ReportDownloadResponse(rawResponse); String actualContents = Streams.readAll(response.getInputStream(), UTF_8); assertEquals("input stream contents are incorrect", expectedContents, actualContents); }
@Nullable public InputStream getInputStream() { return rawResponse.getInputStream(); }
ReportDownloadResponse { @Nullable public InputStream getInputStream() { return rawResponse.getInputStream(); } }
ReportDownloadResponse { @Nullable public InputStream getInputStream() { return rawResponse.getInputStream(); } ReportDownloadResponse(RawReportDownloadResponse rawResponse); }
ReportDownloadResponse { @Nullable public InputStream getInputStream() { return rawResponse.getInputStream(); } ReportDownloadResponse(RawReportDownloadResponse rawResponse); int getHttpStatus(); String getHttpResponseMessage(); @Nullable InputStream getInputStream(); String getAsString(); void saveToFile(String outputFile); }
ReportDownloadResponse { @Nullable public InputStream getInputStream() { return rawResponse.getInputStream(); } ReportDownloadResponse(RawReportDownloadResponse rawResponse); int getHttpStatus(); String getHttpResponseMessage(); @Nullable InputStream getInputStream(); String getAsString(); void saveToFile(String outputFile);  }