@Test(expected = NullPointerException.class) public void nullInputStream() throws IOException { new SOHWriteResponseBodyConsumer().consume(201, null); }
@Override public Map<String, String> consume(final int statusCode, final InputStream response) throws IOException { if (statusCode != 201) { return ImmutableMap.of(); } checkNotNull(response); final BufferedReader reader = new BufferedReader(new InputStreamReader(response, Charsets.UTF_8)); final String objectName = reader.readLine(); while ((reader.readLine()) != null) { } return ImmutableMap.of(Context.X_OG_OBJECT_NAME, objectName); }
SOHWriteResponseBodyConsumer implements ResponseBodyConsumer { @Override public Map<String, String> consume(final int statusCode, final InputStream response) throws IOException { if (statusCode != 201) { return ImmutableMap.of(); } checkNotNull(response); final BufferedReader reader = new BufferedReader(new InputStreamReader(response, Charsets.UTF_8)); final String objectName = reader.readLine(); while ((reader.readLine()) != null) { } return ImmutableMap.of(Context.X_OG_OBJECT_NAME, objectName); } }
SOHWriteResponseBodyConsumer implements ResponseBodyConsumer { @Override public Map<String, String> consume(final int statusCode, final InputStream response) throws IOException { if (statusCode != 201) { return ImmutableMap.of(); } checkNotNull(response); final BufferedReader reader = new BufferedReader(new InputStreamReader(response, Charsets.UTF_8)); final String objectName = reader.readLine(); while ((reader.readLine()) != null) { } return ImmutableMap.of(Context.X_OG_OBJECT_NAME, objectName); }  }
SOHWriteResponseBodyConsumer implements ResponseBodyConsumer { @Override public Map<String, String> consume(final int statusCode, final InputStream response) throws IOException { if (statusCode != 201) { return ImmutableMap.of(); } checkNotNull(response); final BufferedReader reader = new BufferedReader(new InputStreamReader(response, Charsets.UTF_8)); final String objectName = reader.readLine(); while ((reader.readLine()) != null) { } return ImmutableMap.of(Context.X_OG_OBJECT_NAME, objectName); }  @Override Map<String, String> consume(final int statusCode, final InputStream response); @Override String toString(); }
SOHWriteResponseBodyConsumer implements ResponseBodyConsumer { @Override public Map<String, String> consume(final int statusCode, final InputStream response) throws IOException { if (statusCode != 201) { return ImmutableMap.of(); } checkNotNull(response); final BufferedReader reader = new BufferedReader(new InputStreamReader(response, Charsets.UTF_8)); final String objectName = reader.readLine(); while ((reader.readLine()) != null) { } return ImmutableMap.of(Context.X_OG_OBJECT_NAME, objectName); }  @Override Map<String, String> consume(final int statusCode, final InputStream response); @Override String toString();  }