* @throws IOException
*/
private void postAndExceptGiven(String subPath, String postEntity,
MediaType postMediaType, MediaType responseMediaType)
throws IOException {
Representation entity = new StringRepresentation(postEntity,
postMediaType);
final Response response = post(subPath, entity);
sysOutEntityIfError(response);
assertEquals(Status.SUCCESS_OK, response.getStatus());
entity = response.getEntity();
assertEquals(postEntity, entity.getText());
if (responseMediaType != null) {
assertEqualMediaType(responseMediaType, entity);
}
}