@Test public void testDocMissing() throws Exception { ESPushTaskConfig.ESIndexSpec esConfig = getEsIndexSpec("key_avro", false); ESPushTask task = getEsPushTask(); ActionRequestKey inKeyUpdate = ActionRequestKey.newBuilder() .setAction(Action.UPDATE) .setId("foo") .build(); when(task.avroSerde.fromBytes(null)).thenReturn(inKeyUpdate); assertThatThrownBy(() -> task.getAvroKeyOutMsg(getInMsg(null), esConfig)).isInstanceOf(InvalidParameterException.class) .hasMessageContaining("Document must be provided"); ActionRequestKey inKeyIndex = ActionRequestKey.newBuilder() .setAction(Action.INDEX) .setId("foo") .build(); when(task.avroSerde.fromBytes(null)).thenReturn(inKeyIndex); assertThatThrownBy(() -> task.getAvroKeyOutMsg(getInMsg(null), esConfig)).isInstanceOf(InvalidParameterException.class) .hasMessageContaining("Document must be provided"); }
protected OutgoingMessageEnvelope getAvroKeyOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getAvroKeyOutMsg(envelope, spec, Optional.empty()); }
ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getAvroKeyOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getAvroKeyOutMsg(envelope, spec, Optional.empty()); } }
ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getAvroKeyOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getAvroKeyOutMsg(envelope, spec, Optional.empty()); }  }
ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getAvroKeyOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getAvroKeyOutMsg(envelope, spec, Optional.empty()); }  static void main(String [] args); }
ESPushTask extends BaseTask { protected OutgoingMessageEnvelope getAvroKeyOutMsg(IncomingMessageEnvelope envelope, ESPushTaskConfig.ESIndexSpec spec) { return getAvroKeyOutMsg(envelope, spec, Optional.empty()); }  static void main(String [] args);  }