// Path: nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/impl/EventLog.java
// @ToString
// @Getter
// @Setter
// @NoArgsConstructor
// @AllArgsConstructor
// @Builder(toBuilder = true)
// public class EventLog {
// 
//     private Integer id;
//     private String eventType;
//     private String eventBodyData;
//     private String flowId;
//     private Instant created;
//     private Instant lastModified;
//     private String lockedBy;
//     private Instant lockedUntil;
// 
// }
// 
// Path: nakadi-producer/src/main/java/org/zalando/nakadiproducer/transmission/impl/EventBatcher.java
// @AllArgsConstructor
// @Getter
// @EqualsAndHashCode
// @ToString
// protected static class BatchItem {
//     EventLog eventLogEntry;
//     NakadiEvent nakadiEvent;
// }


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.zalando.nakadiproducer.eventlog.impl.EventLog;
import org.zalando.nakadiproducer.transmission.impl.EventBatcher.BatchItem;
import java.util.List;
import java.util.function.Consumer;
import static java.time.Instant.now;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package org.zalando.nakadiproducer.transmission.impl;




public class EventBatcherTest {
    private final ObjectMapper objectMapper = mock(ObjectMapper.class);
    private final Consumer<List<BatchItem>> publisher = mock(Consumer.class);
    private EventBatcher eventBatcher = new EventBatcher(objectMapper, publisher);

    @Test
    public void shouldNotPublishEmptyBatches() {
        eventBatcher.finish();

        verify(publisher, never()).accept(any());
    }

    @Test
    public void shouldPublishNonFilledBatchOnFinish() throws JsonProcessingException {
// Path: nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/impl/EventLog.java
// @ToString
// @Getter
// @Setter
// @NoArgsConstructor
// @AllArgsConstructor
// @Builder(toBuilder = true)
// public class EventLog {
// 
//     private Integer id;
//     private String eventType;
//     private String eventBodyData;
//     private String flowId;
//     private Instant created;
//     private Instant lastModified;
//     private String lockedBy;
//     private Instant lockedUntil;
// 
// }
// 
// Path: nakadi-producer/src/main/java/org/zalando/nakadiproducer/transmission/impl/EventBatcher.java
// @AllArgsConstructor
// @Getter
// @EqualsAndHashCode
// @ToString
// protected static class BatchItem {
//     EventLog eventLogEntry;
//     NakadiEvent nakadiEvent;
// }


// Path: nakadi-producer/src/test/java/org/zalando/nakadiproducer/transmission/impl/EventBatcherTest.java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.zalando.nakadiproducer.eventlog.impl.EventLog;
import org.zalando.nakadiproducer.transmission.impl.EventBatcher.BatchItem;
import java.util.List;
import java.util.function.Consumer;
import static java.time.Instant.now;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

package org.zalando.nakadiproducer.transmission.impl;




public class EventBatcherTest {
    private final ObjectMapper objectMapper = mock(ObjectMapper.class);
    private final Consumer<List<BatchItem>> publisher = mock(Consumer.class);
    private EventBatcher eventBatcher = new EventBatcher(objectMapper, publisher);

    @Test
    public void shouldNotPublishEmptyBatches() {
        eventBatcher.finish();

        verify(publisher, never()).accept(any());
    }

    @Test
    public void shouldPublishNonFilledBatchOnFinish() throws JsonProcessingException {
        EventLog eventLogEntry = eventLogEntry(1, "type");