@Test
public void testProducesFormDataResource() throws Exception {
final Invocation.Builder request = target().path("ProducesFormDataResource").request("multipart/form-data");
FormDataMultiPart result = request.get(FormDataMultiPart.class);
checkMediaType(new MediaType("multipart", "form-data"), result.getMediaType());
assertEquals(3, result.getFields().size());
assertNotNull(result.getField("foo"));
assertEquals("bar", result.getField("foo").getValue());
assertNotNull(result.getField("baz"));
assertEquals("bop", result.getField("baz").getValue());
assertNotNull(result.getField("bean"));
MultiPartBean bean = result.getField("bean").getValueAs(MultiPartBean.class);
assertNotNull(bean);
assertEquals("myname", bean.getName());
assertEquals("myvalue", bean.getValue());
result.cleanup();
}