@Test
public void serializeAsFieldWritesPropertiesIfPropertiesNotExcludedByFilters() throws Exception {

    // given
    String expectedName = UUID.randomUUID().toString();
    String expectedValue = UUID.randomUUID().toString();
    VirtualProperty virtualProperty = spy(createNonDynamicVirtualProperty(expectedName, expectedValue));
    ValueResolver valueResolver = createTestValueResolver(virtualProperty, expectedValue);
    VirtualPropertyFilter virtualPropertyFilter =
            createNonExcludingTestVirtualPropertyFilter(expectedName, expectedValue);
    VirtualPropertiesWriter writer = new VirtualPropertiesWriter(
            new VirtualProperty[] { virtualProperty },
            valueResolver,
            new VirtualPropertyFilter[] { virtualPropertyFilter }
    );
    JsonGenerator jsonGenerator = mock(JsonGenerator.class);
    // when
    writer.serializeAsField(new Object(), jsonGenerator, mock(SerializerProvider.class));
    // then
    verify(jsonGenerator).writeFieldName(eq(expectedName));
    verify(jsonGenerator).writeString(eq(expectedValue));
}