|
22 | 22 | import org.apache.logging.log4j.message.ParameterizedMessage;
|
23 | 23 | import org.apache.lucene.index.CorruptIndexException;
|
24 | 24 | import org.elasticsearch.ElasticsearchException;
|
25 |
| -import org.elasticsearch.action.DocWriteResponse; |
26 | 25 | import org.elasticsearch.action.NoShardAvailableActionException;
|
27 | 26 | import org.elasticsearch.action.get.GetResponse;
|
28 | 27 | import org.elasticsearch.action.index.IndexRequestBuilder;
|
|
61 | 60 | import java.util.concurrent.atomic.AtomicReference;
|
62 | 61 | import java.util.stream.Collectors;
|
63 | 62 |
|
| 63 | +import static org.elasticsearch.action.DocWriteResponse.Result.CREATED; |
| 64 | +import static org.elasticsearch.action.DocWriteResponse.Result.UPDATED; |
64 | 65 | import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
65 | 66 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
66 | 67 | import static org.hamcrest.Matchers.equalTo;
|
67 | 68 | import static org.hamcrest.Matchers.is;
|
| 69 | +import static org.hamcrest.Matchers.isOneOf; |
68 | 70 | import static org.hamcrest.Matchers.not;
|
69 | 71 |
|
70 | 72 | /**
|
@@ -135,7 +137,7 @@ public void testAckedIndexing() throws Exception {
|
135 | 137 | .setSource("{}", XContentType.JSON)
|
136 | 138 | .setTimeout(timeout)
|
137 | 139 | .get(timeout);
|
138 |
| - assertEquals(DocWriteResponse.Result.CREATED, response.getResult()); |
| 140 | + assertThat(response.getResult(), isOneOf(CREATED, UPDATED)); |
139 | 141 | ackedDocs.put(id, node);
|
140 | 142 | logger.trace("[{}] indexed id [{}] through node [{}], response [{}]", name, id, node, response);
|
141 | 143 | } catch (ElasticsearchException e) {
|
|
0 commit comments