@Test
public void writerCreatedWithDeprecatedConstructorWritesGivenProperties() throws Exception {

    // given
    ObjectMapper objectMapper = new ObjectMapper();
    SerializationConfig config = objectMapper.getSerializationConfig();
    JavaType javaType = config.constructType(LogEvent.class);
    AnnotatedClass annotatedClass = createTestAnnotatedClass(config, javaType);
    SimpleBeanPropertyDefinition simpleBeanPropertyDefinition =
            getTestBeanPropertyDefinition(config, javaType, annotatedClass);
    String expectedName = UUID.randomUUID().toString();
    String expectedValue = UUID.randomUUID().toString();
    VirtualProperty virtualProperty = spy(createNonDynamicVirtualProperty(expectedName, expectedValue));
    ValueResolver valueResolver = createTestValueResolver(virtualProperty, expectedValue);
    VirtualPropertiesWriter writer = new VirtualPropertiesWriter(
            simpleBeanPropertyDefinition,
            new AnnotationCollector.OneAnnotation(
                    annotatedClass.getRawType(),
                    annotatedClass.getAnnotations().get(JsonAppend.class)
            ),
            javaType,
            new VirtualProperty[] { virtualProperty },
            valueResolver
    );
    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));
}