Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.instanceOf;
import static org.mockito.Mockito.mock;

/**
Expand Down Expand Up @@ -205,9 +206,8 @@ public void bulk(BulkRequest request, ActionListener<BulkResponse> listener) {
}

public void testIncrementalBulkMissingContent() {
assertThrows(
ElasticsearchParseException.class,
() -> new RestBulkAction(
try {
new RestBulkAction(
Settings.EMPTY,
ClusterSettings.createBuiltInClusterSettings(),
new IncrementalBulkService(mock(Client.class), mock(IndexingPressure.class), MeterRegistry.NOOP)
Expand All @@ -218,8 +218,12 @@ public void testIncrementalBulkMissingContent() {
.build(),
mock(RestChannel.class),
mock(NodeClient.class)
)
);
);
assert false : "must throw";
} catch (Exception e) {
assertThat(e, instanceOf(ElasticsearchParseException.class));
assertEquals("request body is required", e.getMessage());
}
}

public void testIncrementalParsing() {
Expand Down