ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getJsonKeyOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getJsonKeyOutMsg(envelope, spec, Optional.empty()); }  static void main(String [] args);  }
@Test public void testDefaultDocIdWithJsonKeyConfig() throws Exception { ESPushTaskConfig.ESIndexSpec esConfig = getEsIndexSpec("key_json", true); ESPushTask task = getEsPushTask(); String jsonStr = "{\"action\":\"INDEX\",\"id\":null,\"version\":5,\"partition_ts_unix_ms\":4,\"event_ts_unix_ms\":3,\"version_type\":\"force\"}"; OutgoingMessageEnvelope out = task.getJsonKeyOutMsg(getInMsg(jsonStr, ""), 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.FORCE, req.key.getVersionType()); assertEquals(5L, req.key.getVersion().longValue()); }