@Test
public void shouldPostRepresentationSupportingIdWithNoResponseBody() throws Exception {
// Given
clientParameters.setRequireResponseBody(false);
ManagedObjectRepresentation representation = new ManagedObjectRepresentation();
returnResponseWhenPosting(representation);
when(parser.parse(response, 201, ManagedObjectRepresentation.class)).thenReturn(null);
when(response.getLocation()).thenReturn(new URI("http://URI"));
when(parser.parseIdFromLocation(response)).thenReturn(new GId("mo_id"));
// When
ManagedObjectRepresentation result = restConnector.post(PATH, mediaType, representation);
// Then
verify(typeBuilder, never()).accept(any(MediaType.class));
assertThat(result, sameInstance(representation));
assertThat(result.getId(), is(new GId("mo_id")));
}