@Test
public void testSerializeWhenKeyRefHeaderIsSetToNull() {

    final String clearPayload = "clear serialized value";
    final int clearPayloadSize = toByteArray(clearPayload).length;
    Headers headers = new RecordHeaders().add(KafkaCryptoConstants.KEY_REF_HEADER, null);
    given(rawSerializer.serialize("topic1", headers, "final value"))
            .willReturn(toByteArray(clearPayload));
    byte[] result = cryptoSerializer.serialize("topic1", headers, "final value");
    assertThat(result).isEqualTo("clear serialized value".getBytes(StandardCharsets.UTF_8));
    verifyZeroInteractions(encryptor);
}