Skip to content
Snippets Groups Projects
Commit ff061f0e authored by Zhibin Mai's avatar Zhibin Mai
Browse files

Avoid using query with cursor if possible

parent e59952c0
No related branches found
No related tags found
1 merge request!651Avoid using query with cursor if possible
Pipeline #226992 failed
...@@ -215,7 +215,7 @@ public class AugmenterConfigurationServiceImplTest { ...@@ -215,7 +215,7 @@ public class AugmenterConfigurationServiceImplTest {
List<SearchRecord> childrenRecords = gson.fromJson(jsonText, type); List<SearchRecord> childrenRecords = gson.fromJson(jsonText, type);
SearchResponse response = new SearchResponse(); SearchResponse response = new SearchResponse();
response.setResults(childrenRecords); 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> extendedProperties = this.sut.getExtendedProperties("anyId", originalDataMap, propertyConfigurations);
Map<String, Object> expectedExtendedProperties = getDataMap("wellbore_extended_data.json"); Map<String, Object> expectedExtendedProperties = getDataMap("wellbore_extended_data.json");
...@@ -831,13 +831,7 @@ public class AugmenterConfigurationServiceImplTest { ...@@ -831,13 +831,7 @@ public class AugmenterConfigurationServiceImplTest {
// No result // No result
} }
} }
return searchResponse; else if(searchRequest.getKind().toString().contains("osdu:wks:master-data--Well:1.")) {
});
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.")) {
// Return of searchUniqueParentIds(...) // Return of searchUniqueParentIds(...)
SearchRecord searchRecord = new SearchRecord(); SearchRecord searchRecord = new SearchRecord();
Map<String, Object> childDataMap = new HashMap<>(); Map<String, Object> childDataMap = new HashMap<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment