CommonsUploadMultipartInterceptor implements MultipartInterceptor { public boolean accepts(ResourceMethod method) { return ServletFileUpload.isMultipartContent(request); } CommonsUploadMultipartInterceptor(HttpServletRequest request, MutableRequest parameters, MultipartConfig cfg,
		Validator validator, ServletFileUploadCreator fileUploadCreator); boolean accepts(ResourceMethod method); void intercept(InterceptorStack stack, ResourceMethod method, Object instance);  }
@Test public void shouldNotAcceptFormURLEncoded() { interceptor = new CommonsUploadMultipartInterceptor(request, parameters, config, validator, null); when(request.getContentType()).thenReturn("application/x-www-form-urlencoded"); when(request.getMethod()).thenReturn("POST"); assertThat(interceptor.accepts(method), equalTo(false)); }
@Test public void shouldAcceptMultipart() { interceptor = new CommonsUploadMultipartInterceptor(request, parameters, config, validator, null); when(request.getContentType()).thenReturn("multipart/form-data"); when(request.getMethod()).thenReturn("POST"); assertThat(interceptor.accepts(method), equalTo(true)); }