log.warn("This is a WARN message with properties");
log.error("This is an ERROR message with properties", new RuntimeException("Test exception"));
MDC.remove(propertyName);
assertTrue(testListener.getLatch().await(5, TimeUnit.SECONDS));
MessageProperties messageProperties = testListener.getMessageProperties();
assertNotNull(messageProperties);
assertNotNull(messageProperties.getHeaders().get(propertyName));
assertEquals(propertyValue, messageProperties.getHeaders().get(propertyName));
Object location = messageProperties.getHeaders().get("location");
assertNotNull(location);
assertThat(location, instanceOf(String.class));
assertThat((String) location,
startsWith("org.springframework.amqp.rabbit.logback.AmqpAppenderIntegrationTests.testAppenderWithProps()"));
}