@Test
public void throwsWebApplicationExceptionWithStatus_BAD_REQUEST_WhenFieldAnnotatedWithHeaderParamAnnotationCanNotBeResolved() throws Exception {

    when(headerParameterResolver.resolve(isA(Parameter.class), eq(applicationContext))).thenThrow(new Exception());
    FieldInjectorImpl fieldInjector = new FieldInjectorImpl(Resource.class.getDeclaredField("headerParam"), parameterResolverFactory);
    Resource instance = new Resource();
    thrown.expect(webApplicationExceptionWithStatusMatcher(BAD_REQUEST));
    fieldInjector.inject(instance, applicationContext);
}