Add additional assertions to IngestClientIT
This commit is contained in:
parent
7cd128b372
commit
0db3eaf7d7
|
@ -25,6 +25,7 @@ import org.elasticsearch.action.DocWriteResponse;
|
|||
import org.elasticsearch.action.delete.DeleteResponse;
|
||||
import org.elasticsearch.action.index.IndexResponse;
|
||||
import org.elasticsearch.action.update.UpdateResponse;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
|
@ -173,6 +174,11 @@ public class BulkItemResponse implements Streamable, StatusToXContent {
|
|||
builder.field(STATUS_FIELD, status.getStatus());
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Strings.toString(this);
|
||||
}
|
||||
}
|
||||
|
||||
private int id;
|
||||
|
|
|
@ -158,6 +158,9 @@ public class IngestClientIT extends ESIntegTestCase {
|
|||
assertThat(failure.getMessage(), equalTo("java.lang.IllegalArgumentException: test processor failed"));
|
||||
} else {
|
||||
IndexResponse indexResponse = itemResponse.getResponse();
|
||||
assertThat("Expected a successful response but found failure [" + itemResponse.getFailure() + "].",
|
||||
itemResponse.isFailed(), is(false));
|
||||
assertThat(indexResponse, notNullValue());
|
||||
assertThat(indexResponse.getId(), equalTo(Integer.toString(i)));
|
||||
assertThat(indexResponse.isCreated(), is(true));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue