From ff061f0e8f2ebf7797e6777cb857bb9331f9911a Mon Sep 17 00:00:00 2001
From: ZMai <zmai@slb.com>
Date: Thu, 23 Nov 2023 08:25:04 -0600
Subject: [PATCH] Avoid using query with cursor if possible

---
 .../service/AugmenterConfigurationServiceImplTest.java | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/AugmenterConfigurationServiceImplTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/AugmenterConfigurationServiceImplTest.java
index 034393238..57614d83b 100644
--- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/AugmenterConfigurationServiceImplTest.java
+++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/AugmenterConfigurationServiceImplTest.java
@@ -215,7 +215,7 @@ public class AugmenterConfigurationServiceImplTest {
         List<SearchRecord> childrenRecords = gson.fromJson(jsonText, type);
         SearchResponse response = new SearchResponse();
         response.setResults(childrenRecords);
-        when(this.searchService.queryWithCursor(any())).thenReturn(response);
+        when(this.searchService.query(any())).thenReturn(response);
 
         Map<String, Object> extendedProperties = this.sut.getExtendedProperties("anyId", originalDataMap, propertyConfigurations);
         Map<String, Object> expectedExtendedProperties = getDataMap("wellbore_extended_data.json");
@@ -831,13 +831,7 @@ public class AugmenterConfigurationServiceImplTest {
                     // No result
                 }
             }
-            return searchResponse;
-        });
-
-        when(this.searchService.queryWithCursor(any())).thenAnswer(invocation -> {
-            SearchRequest searchRequest = invocation.getArgument(0);
-            SearchResponse searchResponse = new SearchResponse();
-            if(searchRequest.getKind().toString().contains("osdu:wks:master-data--Well:1.")) {
+            else if(searchRequest.getKind().toString().contains("osdu:wks:master-data--Well:1.")) {
                 // Return of searchUniqueParentIds(...)
                 SearchRecord searchRecord = new SearchRecord();
                 Map<String, Object> childDataMap = new HashMap<>();
-- 
GitLab