### Question:
MyResource { @POST @Consumes(MyObject.MIME_TYPE) public String postWithCustomMimeType(MyObject mo) { System.out.println("endpoint invoked (getFruit(" + mo.getIndex() + "))"); return response[Integer.valueOf(mo.getIndex()) % 3]; }  @POST @Consumes(MyObject.MIME_TYPE) String postWithCustomMimeType(MyObject mo); @POST @Path("index") @Consumes("text/plain") String postSimple(int index);  }### Answer:
@Test public void testPostWithCustomMimeType() { String fruit = target .request() .post(Entity.entity(new MyObject(1), MyObject.MIME_TYPE), String.class); assertEquals("banana", fruit); }