Search in sources :

Example 1 with ReplicationRequest

use of org.opensearch.action.support.replication.ReplicationRequest in project OpenSearch by opensearch-project.

the class UpdateRequestTests method runTimeoutTest.

private void runTimeoutTest(final GetResult getResult, final UpdateRequest updateRequest) {
    final UpdateHelper.Result result = updateHelper.prepare(new ShardId("test", "", 0), updateRequest, getResult, OpenSearchTestCase::randomNonNegativeLong);
    final Writeable action = result.action();
    assertThat(action, instanceOf(ReplicationRequest.class));
    final ReplicationRequest<?> request = (ReplicationRequest<?>) action;
    assertThat(request.timeout(), equalTo(updateRequest.timeout()));
}
Also used : ShardId(org.opensearch.index.shard.ShardId) OpenSearchTestCase(org.opensearch.test.OpenSearchTestCase) ReplicationRequest(org.opensearch.action.support.replication.ReplicationRequest) Writeable(org.opensearch.common.io.stream.Writeable)

Aggregations

ReplicationRequest (org.opensearch.action.support.replication.ReplicationRequest)1 Writeable (org.opensearch.common.io.stream.Writeable)1 ShardId (org.opensearch.index.shard.ShardId)1 OpenSearchTestCase (org.opensearch.test.OpenSearchTestCase)1