@Test
public void throwsWebApplicationExceptionWhenMessageBodyReaderForEntityParameterIsNotAvailable() throws Exception {

    when(applicationContext.getProviders()
                           .getMessageBodyReader((Class)entityParameter.getParameterClass(),
                                                 entityParameter.getGenericType(),
                                                 entityParameter.getAnnotations(),
                                                 applicationContext.getContainerRequest().getMediaType()))
            .thenReturn(null);
    when(resourceMethod.getMethodParameters()).thenReturn(newArrayList(entityParameter));
    thrown.expect(webApplicationExceptionWithStatusMatcher(UNSUPPORTED_MEDIA_TYPE));
    methodInvoker.invokeMethod(new EchoResource(), resourceMethod, applicationContext);
}