public void testThree() {
WebResource.Builder builder = client.resource(getUri())
.path("multipart/three").accept("multipart/mixed");
try {
MultiPart result = builder.get(MultiPart.class);
checkMediaType(new MediaType("multipart", "mixed"), result.getMediaType());
assertEquals(2, result.getBodyParts().size());
BodyPart part1 = result.getBodyParts().get(0);
checkMediaType(new MediaType("text", "plain"), part1.getMediaType());
checkEntity("This is the first segment", (BodyPartEntity) part1.getEntity());
BodyPart part2 = result.getBodyParts().get(1);
checkMediaType(new MediaType("x-application", "x-format"), part2.getMediaType());
MultiPartBean entity = part2.getEntityAs(MultiPartBean.class);
assertEquals("myname", entity.getName());
assertEquals("myvalue", entity.getValue());
result.getParameterizedHeaders();
result.cleanup();
} catch (IOException e) {
e.printStackTrace(System.out);
fail("Caught exception: " + e);
} catch(ParseException e) {
e.printStackTrace(System.out);