NIFI-13734 Removed getTook assertions from Elasticsearch Test (#9254)

This commit is contained in:
David Handermann 2024-09-10 16:21:25 -05:00 committed by GitHub
parent c4d11feda5
commit 1101d4d995
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 14 deletions

View File

@ -427,12 +427,10 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
// delete the scroll // delete the scroll
DeleteOperationResponse deleteResponse = service.deleteScroll(scrollResponse.getScrollId()); DeleteOperationResponse deleteResponse = service.deleteScroll(scrollResponse.getScrollId());
assertNotNull(deleteResponse, "Delete Response was null"); assertNotNull(deleteResponse, "Delete Response was null");
assertTrue(deleteResponse.getTook() > 0);
// delete scroll again (should now be unknown but the 404 caught and ignored) // delete scroll again (should now be unknown but the 404 caught and ignored)
deleteResponse = service.deleteScroll(scrollResponse.getScrollId()); deleteResponse = service.deleteScroll(scrollResponse.getScrollId());
assertNotNull(deleteResponse, "Delete Response was null"); assertNotNull(deleteResponse, "Delete Response was null");
assertEquals(0L, deleteResponse.getTook());
} }
@Test @Test
@ -559,12 +557,10 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
// delete pitId // delete pitId
DeleteOperationResponse deleteResponse = service.deletePointInTime(pitId); DeleteOperationResponse deleteResponse = service.deletePointInTime(pitId);
assertNotNull(deleteResponse, "Delete Response was null"); assertNotNull(deleteResponse, "Delete Response was null");
assertTrue(deleteResponse.getTook() > 0);
// delete pitId again (should now be unknown but the 404 caught and ignored) // delete pitId again (should now be unknown but the 404 caught and ignored)
deleteResponse = service.deletePointInTime(pitId); deleteResponse = service.deletePointInTime(pitId);
assertNotNull(deleteResponse, "Delete Response was null"); assertNotNull(deleteResponse, "Delete Response was null");
assertEquals(0L, deleteResponse.getTook());
} }
@Test @Test
@ -575,7 +571,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
.build()).build()); .build()).build());
final DeleteOperationResponse response = service.deleteByQuery(query, INDEX, type, null); final DeleteOperationResponse response = service.deleteByQuery(query, INDEX, type, null);
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
} }
@Test @Test
@ -588,7 +583,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
parameters.put("refresh", "true"); parameters.put("refresh", "true");
final DeleteOperationResponse response = service.deleteByQuery(query, INDEX, type, parameters); final DeleteOperationResponse response = service.deleteByQuery(query, INDEX, type, parameters);
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
} }
@Test @Test
@ -599,7 +593,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
.build()).build()); .build()).build());
final UpdateOperationResponse response = service.updateByQuery(query, INDEX, type, null); final UpdateOperationResponse response = service.updateByQuery(query, INDEX, type, null);
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
} }
@Test @Test
@ -613,7 +606,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
parameters.put("slices", "1"); parameters.put("slices", "1");
final UpdateOperationResponse response = service.updateByQuery(query, INDEX, type, parameters); final UpdateOperationResponse response = service.updateByQuery(query, INDEX, type, parameters);
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
} }
@Test @Test
@ -623,7 +615,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
try { try {
final DeleteOperationResponse response = service.deleteById(INDEX, type, ID, null); final DeleteOperationResponse response = service.deleteById(INDEX, type, ID, null);
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
final ElasticsearchException ee = assertThrows(ElasticsearchException.class, () -> final ElasticsearchException ee = assertThrows(ElasticsearchException.class, () ->
service.get(INDEX, type, ID, null)); service.get(INDEX, type, ID, null));
assertTrue(ee.isNotFound()); assertTrue(ee.isNotFound());
@ -755,7 +746,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
null null
); );
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
waitForIndexRefresh(); waitForIndexRefresh();
Map<String, Object> result = service.get("nulls", type, "1", null); Map<String, Object> result = service.get("nulls", type, "1", null);
@ -765,7 +755,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
suppressNulls(true); suppressNulls(true);
response = service.bulk(Collections.singletonList(new IndexOperationRequest("nulls", type, "2", doc, IndexOperationRequest.Operation.Index, null, false, null, null)), null); response = service.bulk(Collections.singletonList(new IndexOperationRequest("nulls", type, "2", doc, IndexOperationRequest.Operation.Index, null, false, null, null)), null);
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
waitForIndexRefresh(); waitForIndexRefresh();
result = service.get("nulls", type, "2", null); result = service.get("nulls", type, "2", null);
@ -801,7 +790,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
} }
final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true")); final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true"));
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
waitForIndexRefresh(); waitForIndexRefresh();
/* /*
@ -839,7 +827,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
} }
final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true")); final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true"));
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
/* /*
* Now, check to ensure that all indices got populated and refreshed appropriately. * Now, check to ensure that all indices got populated and refreshed appropriately.
@ -882,7 +869,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT {
final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true")); final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true"));
assertNotNull(response); assertNotNull(response);
assertTrue(response.getTook() > 0);
/* /*
* Now, check the dynamic_template was applied * Now, check the dynamic_template was applied