Skip to content

Commit

Permalink
NIFI-13734 Removed getTook assertions from Elasticsearch Test (#9254)
Browse files Browse the repository at this point in the history
  • Loading branch information
exceptionfactory authored Sep 10, 2024
1 parent c4d11fe commit 1101d4d
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,10 @@ void testScroll() throws JsonProcessingException {
// delete the scroll
DeleteOperationResponse deleteResponse = service.deleteScroll(scrollResponse.getScrollId());
assertNotNull(deleteResponse, "Delete Response was null");
assertTrue(deleteResponse.getTook() > 0);

// delete scroll again (should now be unknown but the 404 caught and ignored)
deleteResponse = service.deleteScroll(scrollResponse.getScrollId());
assertNotNull(deleteResponse, "Delete Response was null");
assertEquals(0L, deleteResponse.getTook());
}

@Test
Expand Down Expand Up @@ -559,12 +557,10 @@ void testPointInTime() throws JsonProcessingException {
// delete pitId
DeleteOperationResponse deleteResponse = service.deletePointInTime(pitId);
assertNotNull(deleteResponse, "Delete Response was null");
assertTrue(deleteResponse.getTook() > 0);

// delete pitId again (should now be unknown but the 404 caught and ignored)
deleteResponse = service.deletePointInTime(pitId);
assertNotNull(deleteResponse, "Delete Response was null");
assertEquals(0L, deleteResponse.getTook());
}

@Test
Expand All @@ -575,7 +571,6 @@ void testDeleteByQuery() throws Exception {
.build()).build());
final DeleteOperationResponse response = service.deleteByQuery(query, INDEX, type, null);
assertNotNull(response);
assertTrue(response.getTook() > 0);
}

@Test
Expand All @@ -588,7 +583,6 @@ void testDeleteByQueryRequestParameters() throws Exception {
parameters.put("refresh", "true");
final DeleteOperationResponse response = service.deleteByQuery(query, INDEX, type, parameters);
assertNotNull(response);
assertTrue(response.getTook() > 0);
}

@Test
Expand All @@ -599,7 +593,6 @@ void testUpdateByQuery() throws Exception {
.build()).build());
final UpdateOperationResponse response = service.updateByQuery(query, INDEX, type, null);
assertNotNull(response);
assertTrue(response.getTook() > 0);
}

@Test
Expand All @@ -613,7 +606,6 @@ void testUpdateByQueryRequestParameters() throws Exception {
parameters.put("slices", "1");
final UpdateOperationResponse response = service.updateByQuery(query, INDEX, type, parameters);
assertNotNull(response);
assertTrue(response.getTook() > 0);
}

@Test
Expand All @@ -623,7 +615,6 @@ void testDeleteById() throws Exception {
try {
final DeleteOperationResponse response = service.deleteById(INDEX, type, ID, null);
assertNotNull(response);
assertTrue(response.getTook() > 0);
final ElasticsearchException ee = assertThrows(ElasticsearchException.class, () ->
service.get(INDEX, type, ID, null));
assertTrue(ee.isNotFound());
Expand Down Expand Up @@ -755,7 +746,6 @@ void testNullSuppression() throws InterruptedException {
null
);
assertNotNull(response);
assertTrue(response.getTook() > 0);
waitForIndexRefresh();

Map<String, Object> result = service.get("nulls", type, "1", null);
Expand All @@ -765,7 +755,6 @@ void testNullSuppression() throws InterruptedException {
suppressNulls(true);
response = service.bulk(Collections.singletonList(new IndexOperationRequest("nulls", type, "2", doc, IndexOperationRequest.Operation.Index, null, false, null, null)), null);
assertNotNull(response);
assertTrue(response.getTook() > 0);
waitForIndexRefresh();

result = service.get("nulls", type, "2", null);
Expand Down Expand Up @@ -801,7 +790,6 @@ void testBulkAddTwoIndexes() throws Exception {
}
final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true"));
assertNotNull(response);
assertTrue(response.getTook() > 0);
waitForIndexRefresh();

/*
Expand Down Expand Up @@ -839,7 +827,6 @@ void testBulkRequestParametersAndBulkHeaders() {
}
final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true"));
assertNotNull(response);
assertTrue(response.getTook() > 0);

/*
* Now, check to ensure that all indices got populated and refreshed appropriately.
Expand Down Expand Up @@ -882,7 +869,6 @@ IndexOperationRequest.Operation.Index, null, false, new MapBuilder().of("hello",

final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true"));
assertNotNull(response);
assertTrue(response.getTook() > 0);

/*
* Now, check the dynamic_template was applied
Expand Down

0 comments on commit 1101d4d

Please sign in to comment.