Spring Kafka integration test Error while writing to highwatermark file

Do you actually have permissions to write to /var/folders/s3 ...?

You can override the location with

public EmbeddedKafkaBroker embeddedKafkaBroker() {
    return new EmbeddedKafkaBroker(1,false,2,"test-events")
        .brokerProperties(Collections.singletonMap(KafkaConfig.LogDirProp(), "/tmp/foo"));

I had similar issue and with help of Gary Russell answer I solved it by pointing log dir to gradle build output dir log.dir=out/embedded-kafka or in case of maven log.dir=target/embedded-kafka.

The following code snippet shows how to do it using @EmbeddedKafka.

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = {Application.class})
        topics = "topic",
        partitions = 1,
        controlledShutdown = true,
        properties = {
public class OutboxEventsTest {