use of com.tomtom.james.common.api.publisher.Event in project james by tomtom-international.
the class Log4j2PublisherTest method shouldLogEvent.
@Test
public void shouldLogEvent() {
SimpleLogger logger = (SimpleLogger) LogManager.getLogger(LOGGER_NAME);
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
logger.setStream(new PrintStream(byteArrayOutputStream));
createPublisher().publish(new Event(Collections.singletonMap("key", "value"), Instant.EPOCH));
assertThat(byteArrayOutputStream.toString().trim()).isEqualTo("INFO logger @created=\"1970-01-01T00:00:00Z\" key=\"value\" type=\"james\"");
}
Aggregations