@Test
public void shouldGetOutputStreamForPutWithBody() throws Throwable {

  final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
  final ByteArrayInputStream inputStream = new ByteArrayInputStream(RESPONSE_BODY);
  when(mockHttpURLConnection.getOutputStream()).thenReturn(outputStream);
  when(mockHttpURLConnection.getInputStream()).thenReturn(inputStream);
  assertThat(httpFunction().apply(HTTP_PUT_WITH_BODY_REQUEST), is(notNullValue()));
  verify(mockHttpURLConnection).setDoInput(true);
  verify(mockHttpURLConnection).disconnect();
  assertThat(outputStream.toByteArray(), is(REQUEST_BODY));
}