From 1101d4d9952a360c24355a9bd6c46f8d071a87d7 Mon Sep 17 00:00:00 2001 From: David Handermann Date: Tue, 10 Sep 2024 16:21:25 -0500 Subject: [PATCH] NIFI-13734 Removed getTook assertions from Elasticsearch Test (#9254) --- .../integration/ElasticSearchClientService_IT.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/java/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.java b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/java/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.java index 09c0abdcd0..c4d7b87fc9 100644 --- a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/java/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.java +++ b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/java/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.java @@ -427,12 +427,10 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { // 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 @@ -559,12 +557,10 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { // 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 @@ -575,7 +571,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { .build()).build()); final DeleteOperationResponse response = service.deleteByQuery(query, INDEX, type, null); assertNotNull(response); - assertTrue(response.getTook() > 0); } @Test @@ -588,7 +583,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { parameters.put("refresh", "true"); final DeleteOperationResponse response = service.deleteByQuery(query, INDEX, type, parameters); assertNotNull(response); - assertTrue(response.getTook() > 0); } @Test @@ -599,7 +593,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { .build()).build()); final UpdateOperationResponse response = service.updateByQuery(query, INDEX, type, null); assertNotNull(response); - assertTrue(response.getTook() > 0); } @Test @@ -613,7 +606,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { parameters.put("slices", "1"); final UpdateOperationResponse response = service.updateByQuery(query, INDEX, type, parameters); assertNotNull(response); - assertTrue(response.getTook() > 0); } @Test @@ -623,7 +615,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { 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()); @@ -755,7 +746,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { null ); assertNotNull(response); - assertTrue(response.getTook() > 0); waitForIndexRefresh(); Map result = service.get("nulls", type, "1", null); @@ -765,7 +755,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { 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); @@ -801,7 +790,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { } final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true")); assertNotNull(response); - assertTrue(response.getTook() > 0); waitForIndexRefresh(); /* @@ -839,7 +827,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { } 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. @@ -882,7 +869,6 @@ class ElasticSearchClientService_IT extends AbstractElasticsearch_IT { final IndexOperationResponse response = service.bulk(payload, createParameters("refresh", "true")); assertNotNull(response); - assertTrue(response.getTook() > 0); /* * Now, check the dynamic_template was applied