@Test public void failsGetBodyAsCustomTypeWhenMessageBodyReaderForThisTypeIsNotAvailable() throws Exception { Class<List> type = List.class; ParameterizedType genericType = newParameterizedType(List.class, String.class); InputStream in = mock(InputStream.class); when(fileItem.getInputStream()).thenReturn(in); when(fileItem.getContentType()).thenReturn(TEXT_PLAIN_TYPE.toString()); thrown.expect(RuntimeException.class); inputItem.getBody(type, genericType); }
@Override public InputStream getBody() throws IOException { return fileItem.getInputStream(); }
DefaultInputItem implements InputItem { @Override public InputStream getBody() throws IOException { return fileItem.getInputStream(); } }
DefaultInputItem implements InputItem { @Override public InputStream getBody() throws IOException { return fileItem.getInputStream(); } DefaultInputItem(FileItem fileItem, Providers providers); }
DefaultInputItem implements InputItem { @Override public InputStream getBody() throws IOException { return fileItem.getInputStream(); } DefaultInputItem(FileItem fileItem, Providers providers); @Override String getName(); @Override String getFilename(); @Override MediaType getMediaType(); @Override MultivaluedMap<String, String> getHeaders(); @Override InputStream getBody(); @Override T getBody(Class<T> type, Type genericType); @Override String getBodyAsString(); }
DefaultInputItem implements InputItem { @Override public InputStream getBody() throws IOException { return fileItem.getInputStream(); } DefaultInputItem(FileItem fileItem, Providers providers); @Override String getName(); @Override String getFilename(); @Override MediaType getMediaType(); @Override MultivaluedMap<String, String> getHeaders(); @Override InputStream getBody(); @Override T getBody(Class<T> type, Type genericType); @Override String getBodyAsString();  }