@Test
public void usesSetterForSettingField() throws Exception {

    when(headerParameterResolver.resolve(isA(Parameter.class), eq(applicationContext))).thenReturn("header parameter");
    FieldInjectorImpl fieldInjector = new FieldInjectorImpl(Resource.class.getDeclaredField("headerParam"), parameterResolverFactory);
    Resource instance = spy(new Resource());
    fieldInjector.inject(instance, applicationContext);
    assertEquals("header parameter", instance.headerParam);
    verify(instance).setHeaderParam("header parameter");
}