@Test
public void serializeAsFieldResolvesVirtualPropertyValue() throws Exception {

    // given
    String expectedValue = UUID.randomUUID().toString();
    VirtualProperty virtualProperty = spy(createNonDynamicVirtualProperty(null, expectedValue));
    ValueResolver valueResolver = mock(ValueResolver.class);
    VirtualPropertiesWriter writer = new VirtualPropertiesWriter(
            new VirtualProperty[] { virtualProperty },
            valueResolver
    );
    // when
    writer.serializeAsField(new Object(), mock(JsonGenerator.class), mock(SerializerProvider.class));
    // then
    verify(valueResolver).resolve(eq(virtualProperty));
}