2424import org .opensearch .transport .client .Client ;
2525
2626import static org .mockito .ArgumentMatchers .any ;
27+ import static org .mockito .ArgumentMatchers .eq ;
2728import static org .mockito .ArgumentMatchers .nullable ;
2829import static org .mockito .Mockito .doAnswer ;
2930import static org .mockito .Mockito .mock ;
@@ -66,13 +67,18 @@ public void testSearchWorkflow() {
6667
6768 doAnswer (invocation -> {
6869 SearchRequest request = invocation .getArgument (0 );
69- ActionListener <SearchResponse > responseListener = invocation .getArgument (1 );
70+ ActionListener <SearchResponse > responseListener = invocation .getArgument (3 );
7071 ThreadContext .StoredContext storedContext = mock (ThreadContext .StoredContext .class );
7172 searchHandler .validateRole (request , null , null , null , responseListener , storedContext );
7273 responseListener .onResponse (mock (SearchResponse .class ));
7374 return null ;
7475 }).when (searchHandler )
75- .search (any (SearchRequest .class ), nullable (String .class ), CommonValue .WORKFLOW_STATE_RESOURCE_TYPE , any (ActionListener .class ));
76+ .search (
77+ any (SearchRequest .class ),
78+ nullable (String .class ),
79+ eq (CommonValue .WORKFLOW_STATE_RESOURCE_TYPE ),
80+ any (ActionListener .class )
81+ );
7682
7783 doAnswer (invocation -> {
7884 ActionListener <SearchResponse > responseListener = invocation .getArgument (1 );
@@ -84,7 +90,7 @@ public void testSearchWorkflow() {
8490 verify (searchHandler ).search (
8591 any (SearchRequest .class ),
8692 nullable (String .class ),
87- CommonValue .WORKFLOW_RESOURCE_TYPE ,
93+ eq ( CommonValue .WORKFLOW_STATE_RESOURCE_TYPE ) ,
8894 any (ActionListener .class )
8995 );
9096 }
0 commit comments