use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.index.IndexRequest in project samza by apache.
the class DefaultIndexRequestFactoryTest method testGetIndexRequestWithId.
@Test
public void testGetIndexRequestWithId() throws Exception {
IndexRequest indexRequest = INDEX_REQUEST_FACTORY.getIndexRequest(new OutgoingMessageEnvelope(SYSTEM, "id", EMPTY_MSG));
assertEquals("id", indexRequest.id());
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.index.IndexRequest in project samza by apache.
the class DefaultIndexRequestFactoryTest method testGetIndexRequestNoPartitionKey.
@Test
public void testGetIndexRequestNoPartitionKey() throws Exception {
IndexRequest indexRequest = INDEX_REQUEST_FACTORY.getIndexRequest(new OutgoingMessageEnvelope(SYSTEM, EMPTY_MSG));
assertNull(indexRequest.routing());
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.index.IndexRequest in project samza by apache.
the class DefaultIndexRequestFactoryTest method testGetIndexRequestStreamName.
@Test
public void testGetIndexRequestStreamName() {
IndexRequest indexRequest = INDEX_REQUEST_FACTORY.getIndexRequest(new OutgoingMessageEnvelope(SYSTEM, EMPTY_MSG));
assertEquals(INDEX, indexRequest.index());
assertEquals(TYPE, indexRequest.type());
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.index.IndexRequest in project samza by apache.
the class DefaultIndexRequestFactoryTest method testGetIndexRequestMessageMap.
@Test
public void testGetIndexRequestMessageMap() throws Exception {
IndexRequest indexRequest = INDEX_REQUEST_FACTORY.getIndexRequest(new OutgoingMessageEnvelope(SYSTEM, Collections.singletonMap("foo", "bar")));
assertEquals(Collections.singletonMap("foo", "bar"), indexRequest.sourceAsMap());
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.index.IndexRequest in project samza by apache.
the class DefaultIndexRequestFactoryTest method testGetIndexRequestWithPartitionKey.
@Test
public void testGetIndexRequestWithPartitionKey() throws Exception {
IndexRequest indexRequest = INDEX_REQUEST_FACTORY.getIndexRequest(new OutgoingMessageEnvelope(SYSTEM, "shardKey", "id", EMPTY_MSG));
assertEquals("shardKey", indexRequest.routing());
}
Aggregations