Skip to content

Commit 62a9dc5

Browse files
committed
Adapt ActionFilter interface to core change
The PR opensearch-project/OpenSearch#18523 needs to add a new parameter to the apply() method of the ActionFilter interface. This adds the parameter to the ActionFilter implementations. Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
1 parent 265be39 commit 62a9dc5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/org/opensearch/ubi/UbiActionFilter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.opensearch.action.search.SearchResponse;
2424
import org.opensearch.action.support.ActionFilter;
2525
import org.opensearch.action.support.ActionFilterChain;
26+
import org.opensearch.action.support.ActionRequestMetadata;
2627
import org.opensearch.common.xcontent.XContentType;
2728
import org.opensearch.core.action.ActionListener;
2829
import org.opensearch.core.action.ActionResponse;
@@ -79,6 +80,7 @@ public <Request extends ActionRequest, Response extends ActionResponse> void app
7980
Task task,
8081
String action,
8182
Request request,
83+
ActionRequestMetadata<Request, Response> actionRequestMetadata,
8284
ActionListener<Response> listener,
8385
ActionFilterChain<Request, Response> chain
8486
) {

src/test/java/org/opensearch/ubi/UbiActionFilterTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.opensearch.action.search.SearchRequest;
1515
import org.opensearch.action.search.SearchResponse;
1616
import org.opensearch.action.support.ActionFilterChain;
17+
import org.opensearch.action.support.ActionRequestMetadata;
1718
import org.opensearch.common.action.ActionFuture;
1819
import org.opensearch.common.settings.Settings;
1920
import org.opensearch.common.unit.TimeValue;
@@ -98,7 +99,7 @@ public void testApplyWithoutUbiBlock() {
9899

99100
when(request.source()).thenReturn(searchSourceBuilder);
100101

101-
ubiActionFilter.apply(task, "ubi", request, listener, chain);
102+
ubiActionFilter.apply(task, "ubi", request, ActionRequestMetadata.empty(), listener, chain);
102103

103104
verify(client, never()).index(any(), any());
104105

@@ -157,7 +158,7 @@ public void testApplyWithUbiBlockWithoutQueryId() {
157158

158159
when(request.source()).thenReturn(searchSourceBuilder);
159160

160-
ubiActionFilter.apply(task, "ubi", request, listener, chain);
161+
ubiActionFilter.apply(task, "ubi", request, ActionRequestMetadata.empty(), listener, chain);
161162

162163
verify(client, atMostOnce()).index(any(), any());
163164

0 commit comments

Comments
 (0)