@Test
void messages() throws IOException {

    ConsumerRecord<byte[], byte[]> record = new ConsumerRecord<>("topic", 0, 1, Strings.bytes("key"), Strings.bytes("{}"));
    record.headers().add(MessageHeaders.HEADER_CLIENT, Strings.bytes("client"));
    record.headers().add(MessageHeaders.HEADER_REF_ID, Strings.bytes("refId"));
    record.headers().add(MessageHeaders.HEADER_CORRELATION_ID, Strings.bytes("correlationId"));
    var actionLog = new ActionLog(null, null);
    List<Message<TestMessage>> messages = thread.messages(List.of(record), actionLog, JSONMapper.reader(TestMessage.class));
    assertThat(messages).hasSize(1);
    assertThat(messages.get(0).key).isEqualTo("key");
    assertThat(actionLog.context.get("key")).containsExactly("key");
    assertThat(actionLog.clients).containsExactly("client");
    assertThat(actionLog.refIds).containsExactly("refId");
    assertThat(actionLog.correlationIds).containsExactly("correlationId");
}