@Test public void testDefaultDocIdWithEmbeddedConfig() throws Exception { ESPushTaskConfig.ESIndexSpec esConfig = getEsIndexSpec("embedded", true); ESPushTask task = getEsPushTask(); HashMap<String, Object> doc = new HashMap<>(); when(task.jsonSerde.fromBytes(null)).thenReturn(doc); when(task.jsonSerde.toString(doc)).thenReturn(""); long tsNowMs = 1453952662L; OutgoingMessageEnvelope out = task.getEmbeddedOutMsg(getInMsg(null), esConfig, Optional.of(tsNowMs)); HTTPBulkLoader.ActionRequest req = (HTTPBulkLoader.ActionRequest) out.getMessage(); assertEquals("fake-0-1234", req.key.getId().toString()); assertEquals(Action.INDEX, req.key.getAction()); assertEquals(tsNowMs, req.key.getPartitionTsUnixMs().longValue()); assertNull("Do not default event time", req.key.getEventTsUnixMs()); assertNull("Version not set", req.key.getVersion()); assertNull("Version type not set", req.key.getVersionType()); }
protected OutgoingMessageEnvelope getEmbeddedOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getEmbeddedOutMsg(envelope, spec, Optional.empty()); }
ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getEmbeddedOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getEmbeddedOutMsg(envelope, spec, Optional.empty()); } }
ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getEmbeddedOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getEmbeddedOutMsg(envelope, spec, Optional.empty()); }  }
ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getEmbeddedOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getEmbeddedOutMsg(envelope, spec, Optional.empty()); }  static void main(String [] args); }
ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getEmbeddedOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getEmbeddedOutMsg(envelope, spec, Optional.empty()); }  static void main(String [] args);  }