@UseDataProvider("annotationTypesWhenNeedToThrowWebApplicationExceptionWithStatusBadRequest")
@Test
public <A extends Annotation> void throwsWebApplicationExceptionWithStatusBadRequestWhenFailResolveParameterAnnotatedWith(Class<A> annotationType) throws Exception {

    when(resourceMethod.getMethodParameters()).thenReturn(newArrayList(annotatedParameter));
    when(parameterAnnotation.annotationType()).thenReturn((Class)annotationType);
    Exception thrownByParameterResolver = new Exception();
    when(parameterResolver.resolve(annotatedParameter, applicationContext)).thenThrow(thrownByParameterResolver);
    thrown.expect(webApplicationExceptionWithStatusMatcher(BAD_REQUEST));
    methodInvoker.invokeMethod(new EchoResource(), resourceMethod, applicationContext);
}