@Test
public void testDefaultDocIdWithAvroKeyConfig() throws Exception {

    ESPushTaskConfig.ESIndexSpec esConfig = getEsIndexSpec("key_avro", true);
    ESPushTask task = getEsPushTask();
    ActionRequestKey inKey = ActionRequestKey.newBuilder()
        .setEventTsUnixMs(3L)
        .setPartitionTsUnixMs(4L)
        .setVersionType(VersionType.EXTERNAL)
        .setVersion(5L)
        .build();
    when(task.avroSerde.fromBytes(null)).thenReturn(inKey);
    OutgoingMessageEnvelope out = task.getAvroKeyOutMsg(getInMsg(""), esConfig);
    HTTPBulkLoader.ActionRequest req = (HTTPBulkLoader.ActionRequest) out.getMessage();
    assertEquals("fake-0-1234", req.key.getId().toString());
    assertEquals(Action.INDEX, req.key.getAction());
    assertEquals(4L, req.key.getPartitionTsUnixMs().longValue());
    assertEquals(3L, req.key.getEventTsUnixMs().longValue());
    assertEquals(VersionType.EXTERNAL, req.key.getVersionType());
    assertEquals(5L, req.key.getVersion().longValue());
}