code: public Properties consumerConfig(boolean enableAutoCommit) {
          Properties props = new Properties();
          props.put("bootstrap.servers", LOCALHOST + ":" + kafkaPort);
          props.put("group.id", "kafka-junit-consumer");
          props.put("enable.auto.commit", String.valueOf(enableAutoCommit));
          props.put("auto.commit.interval.ms", "10");
          props.put("auto.offset.reset", "earliest");
          props.put("heartbeat.interval.ms", "100");
          props.put("session.timeout.ms", "200");
          props.put("fetch.max.wait.ms", "200");
          props.put("metadata.max.age.ms", "100");
  
          return props;
      }
docs: Create a minimal consumer configuration. Offset is set to "earliest".
  @param enableAutoCommit Enable auto commit
  @return Properties