Skip to content

Commit

Permalink
Fix spotlesscheck
Browse files Browse the repository at this point in the history
Signed-off-by: Liyun Xiu <xiliyun@amazon.com>
  • Loading branch information
chishui committed Apr 24, 2024
1 parent b74e142 commit 8d302cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 10 additions & 3 deletions server/src/test/java/org/opensearch/ingest/IngestServiceTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1806,9 +1806,15 @@ public void testExecuteBulkRequestInBatchNoValidPipeline() {
createPipeline("_id", ingestService);
BulkRequest bulkRequest = new BulkRequest();
// will not be handled as not valid document type
IndexRequest indexRequest1 = new IndexRequest("_index").id("_id1").source(emptyMap()).setPipeline("_none").setFinalPipeline("_none");
IndexRequest indexRequest1 = new IndexRequest("_index").id("_id1")
.source(emptyMap())
.setPipeline("_none")
.setFinalPipeline("_none");
bulkRequest.add(indexRequest1);
IndexRequest indexRequest2 = new IndexRequest("_index").id("_id2").source(emptyMap()).setPipeline("_none").setFinalPipeline("_none");
IndexRequest indexRequest2 = new IndexRequest("_index").id("_id2")
.source(emptyMap())
.setPipeline("_none")
.setFinalPipeline("_none");
bulkRequest.add(indexRequest2);
bulkRequest.batchIngestionOption("enabled");
bulkRequest.maximumBatchSize(2);
Expand Down Expand Up @@ -1913,7 +1919,8 @@ public void testExecuteBulkRequestInBatchWithExceptionInCallback() {

List<IngestDocumentWrapper> results = Arrays.asList(
new IngestDocumentWrapper(0, IngestService.toIngestDocument(indexRequest1), null),
new IngestDocumentWrapper(1, null, new RuntimeException()));
new IngestDocumentWrapper(1, null, new RuntimeException())
);
doAnswer(args -> {
@SuppressWarnings("unchecked")
Consumer<List<IngestDocumentWrapper>> handler = (Consumer) args.getArguments()[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ public void test_batchExecute_success() {

public void test_batchExecute_empty() {
processor = new FakeProcessor("type", "tag", "description", doc -> { doc.setFieldValue(FIELD_KEY, FIELD_VALUE_PROCESSED); });
processor.batchExecute(Collections.emptyList(), results -> {
assertEquals(0, results.size());
});
processor.batchExecute(Collections.emptyList(), results -> { assertEquals(0, results.size()); });
}

public void test_batchExecute_exception() {
Expand Down

0 comments on commit 8d302cc

Please sign in to comment.