diff --git a/src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java b/src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java index c3b72118..078ab3d2 100644 --- a/src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java +++ b/src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java @@ -40,6 +40,7 @@ import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryBuilders; import org.opensearch.plugins.PluginsService; +import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; @@ -69,6 +70,7 @@ public class CreateWorkflowTransportAction extends HandledTransportAction executeDeleteRequest(request, listener, context), client, + sdkClient, clusterService, xContentRegistry ); diff --git a/src/main/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportAction.java b/src/main/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportAction.java index 44e99af7..d0119d65 100644 --- a/src/main/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportAction.java +++ b/src/main/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportAction.java @@ -37,6 +37,7 @@ import org.opensearch.flowframework.workflow.WorkflowData; import org.opensearch.flowframework.workflow.WorkflowStep; import org.opensearch.flowframework.workflow.WorkflowStepFactory; +import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.tasks.Task; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -73,6 +74,7 @@ public class DeprovisionWorkflowTransportAction extends HandledTransportAction listener) { + String tenantId = request.getTemplate() == null ? null : request.getTemplate().getTenantId(); + if (!TenantAwareHelper.validateTenantId(flowFrameworkSettings.isMultiTenancyEnabled(), tenantId, listener)) { + return; + } String workflowId = request.getWorkflowId(); - User user = getUserContext(client); // Stash thread context to interact with system index @@ -129,10 +136,13 @@ protected void doExecute(Task task, WorkflowRequest request, ActionListener executeDeprovisionRequest(request, listener, context), client, + sdkClient, clusterService, xContentRegistry ); @@ -149,10 +159,6 @@ private void executeDeprovisionRequest( ActionListener listener, ThreadContext.StoredContext context ) { - String tenantId = request.getTemplate() == null ? null : request.getTemplate().getTenantId(); - if (!TenantAwareHelper.validateTenantId(flowFrameworkSettings.isMultiTenancyEnabled(), tenantId, listener)) { - return; - } String workflowId = request.getWorkflowId(); String allowDelete = request.getParams().get(ALLOW_DELETE); GetWorkflowStateRequest getStateRequest = new GetWorkflowStateRequest(workflowId, true); diff --git a/src/main/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportAction.java b/src/main/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportAction.java index bf374e05..9901d90b 100644 --- a/src/main/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportAction.java +++ b/src/main/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportAction.java @@ -25,10 +25,12 @@ import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.flowframework.common.FlowFrameworkSettings; import org.opensearch.flowframework.exception.FlowFrameworkException; import org.opensearch.flowframework.model.WorkflowState; import org.opensearch.flowframework.util.ParseUtils; import org.opensearch.index.IndexNotFoundException; +import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; @@ -47,7 +49,9 @@ public class GetWorkflowStateTransportAction extends HandledTransportAction executeGetWorkflowStateRequest(request, listener, context), client, + sdkClient, clusterService, xContentRegistry ); diff --git a/src/main/java/org/opensearch/flowframework/transport/GetWorkflowTransportAction.java b/src/main/java/org/opensearch/flowframework/transport/GetWorkflowTransportAction.java index 8e1e711b..ce7bfc24 100644 --- a/src/main/java/org/opensearch/flowframework/transport/GetWorkflowTransportAction.java +++ b/src/main/java/org/opensearch/flowframework/transport/GetWorkflowTransportAction.java @@ -31,6 +31,7 @@ import org.opensearch.flowframework.util.EncryptorUtils; import org.opensearch.flowframework.util.ParseUtils; import org.opensearch.flowframework.util.TenantAwareHelper; +import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; @@ -49,6 +50,7 @@ public class GetWorkflowTransportAction extends HandledTransportAction executeGetRequest(request, listener, context), client, + sdkClient, clusterService, xContentRegistry ); diff --git a/src/main/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportAction.java b/src/main/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportAction.java index c4fd6b51..0484f6cc 100644 --- a/src/main/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportAction.java +++ b/src/main/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportAction.java @@ -37,6 +37,7 @@ import org.opensearch.flowframework.workflow.ProcessNode; import org.opensearch.flowframework.workflow.WorkflowProcessSorter; import org.opensearch.plugins.PluginsService; +import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.tasks.Task; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -71,6 +72,7 @@ public class ProvisionWorkflowTransportAction extends HandledTransportAction executeProvisionRequest(request, listener, context), client, + sdkClient, clusterService, xContentRegistry ); diff --git a/src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java b/src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java index 5ae101e3..a0825dd3 100644 --- a/src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java +++ b/src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java @@ -39,6 +39,7 @@ import org.opensearch.flowframework.workflow.WorkflowProcessSorter; import org.opensearch.flowframework.workflow.WorkflowStepFactory; import org.opensearch.plugins.PluginsService; +import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.tasks.Task; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -72,6 +73,7 @@ public class ReprovisionWorkflowTransportAction extends HandledTransportAction executeReprovisionRequest(request, listener, context), client, + sdkClient, clusterService, xContentRegistry ); diff --git a/src/main/java/org/opensearch/flowframework/util/ParseUtils.java b/src/main/java/org/opensearch/flowframework/util/ParseUtils.java index 154e343f..f6d6ed84 100644 --- a/src/main/java/org/opensearch/flowframework/util/ParseUtils.java +++ b/src/main/java/org/opensearch/flowframework/util/ParseUtils.java @@ -44,6 +44,7 @@ import org.opensearch.index.query.QueryBuilders; import org.opensearch.index.query.TermsQueryBuilder; import org.opensearch.ml.repackage.com.google.common.collect.ImmutableList; +import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.search.builder.SearchSourceBuilder; import java.io.FileNotFoundException; @@ -283,20 +284,26 @@ public static SearchSourceBuilder addUserBackendRolesFilter(User user, SearchSou * Resolve user and execute the function * @param requestedUser the user to execute the request * @param workflowId workflow id + * @param tenantId tenant id * @param filterByEnabled filter by enabled setting + * @param isMultitenancyEnabled whether multitenancy is enabled * @param listener action listener * @param function workflow function * @param client node client + * @param sdkClient multitenant client * @param clusterService cluster service * @param xContentRegistry contentRegister to parse get response */ public static void resolveUserAndExecute( User requestedUser, String workflowId, + String tenantId, Boolean filterByEnabled, + boolean isMultitenancyEnabled, ActionListener listener, Runnable function, Client client, + SdkClient sdkClient, ClusterService clusterService, NamedXContentRegistry xContentRegistry ) { diff --git a/src/test/java/org/opensearch/flowframework/transport/CreateWorkflowTransportActionTests.java b/src/test/java/org/opensearch/flowframework/transport/CreateWorkflowTransportActionTests.java index ba76bc83..07994603 100644 --- a/src/test/java/org/opensearch/flowframework/transport/CreateWorkflowTransportActionTests.java +++ b/src/test/java/org/opensearch/flowframework/transport/CreateWorkflowTransportActionTests.java @@ -30,6 +30,7 @@ import org.opensearch.commons.ConfigConstants; import org.opensearch.core.action.ActionListener; import org.opensearch.core.index.shard.ShardId; +import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.flowframework.TestHelpers; import org.opensearch.flowframework.common.FlowFrameworkSettings; import org.opensearch.flowframework.indices.FlowFrameworkIndex; @@ -40,6 +41,8 @@ import org.opensearch.flowframework.model.WorkflowNode; import org.opensearch.flowframework.workflow.WorkflowProcessSorter; import org.opensearch.plugins.PluginsService; +import org.opensearch.remote.metadata.client.SdkClient; +import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.tasks.Task; @@ -90,6 +93,7 @@ public class CreateWorkflowTransportActionTests extends OpenSearchTestCase { private WorkflowProcessSorter workflowProcessSorter; private Template template; private Client client; + private SdkClient sdkClient; private ThreadPool threadPool; private FlowFrameworkSettings flowFrameworkSettings; private PluginsService pluginsService; @@ -100,6 +104,7 @@ public class CreateWorkflowTransportActionTests extends OpenSearchTestCase { public void setUp() throws Exception { super.setUp(); client = mock(Client.class); + this.sdkClient = SdkClientFactory.createSdkClient(client, NamedXContentRegistry.EMPTY, Collections.emptyMap()); threadPool = mock(ThreadPool.class); this.flowFrameworkSettings = mock(FlowFrameworkSettings.class); @@ -140,6 +145,7 @@ public void setUp() throws Exception { flowFrameworkIndicesHandler, flowFrameworkSettings, client, + sdkClient, pluginsService, clusterService, xContentRegistry(), @@ -376,6 +382,7 @@ public void testCreateWithUserAndFilterOn() { flowFrameworkIndicesHandler, flowFrameworkSettings, client, + sdkClient, pluginsService, clusterService, xContentRegistry(), @@ -439,6 +446,7 @@ public void testFailedToCreateNewWorkflowWithNullUser() { flowFrameworkIndicesHandler, flowFrameworkSettings, client, + sdkClient, pluginsService, clusterService, xContentRegistry(), @@ -474,6 +482,7 @@ public void testFailedToCreateNewWorkflowWithNoBackendRoleUser() { flowFrameworkIndicesHandler, flowFrameworkSettings, client, + sdkClient, pluginsService, clusterService, xContentRegistry(), diff --git a/src/test/java/org/opensearch/flowframework/transport/DeleteWorkflowTransportActionTests.java b/src/test/java/org/opensearch/flowframework/transport/DeleteWorkflowTransportActionTests.java index 6012e5b8..eeb5d3d9 100644 --- a/src/test/java/org/opensearch/flowframework/transport/DeleteWorkflowTransportActionTests.java +++ b/src/test/java/org/opensearch/flowframework/transport/DeleteWorkflowTransportActionTests.java @@ -20,8 +20,11 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.index.Index; import org.opensearch.core.index.shard.ShardId; +import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.flowframework.common.FlowFrameworkSettings; import org.opensearch.flowframework.indices.FlowFrameworkIndicesHandler; +import org.opensearch.remote.metadata.client.SdkClient; +import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; @@ -44,6 +47,7 @@ public class DeleteWorkflowTransportActionTests extends OpenSearchTestCase { private Client client; + private SdkClient sdkClient; private DeleteWorkflowTransportAction deleteWorkflowTransportAction; private FlowFrameworkIndicesHandler flowFrameworkIndicesHandler; private FlowFrameworkSettings flowFrameworkSettings; @@ -52,6 +56,7 @@ public class DeleteWorkflowTransportActionTests extends OpenSearchTestCase { public void setUp() throws Exception { super.setUp(); this.client = mock(Client.class); + this.sdkClient = SdkClientFactory.createSdkClient(client, NamedXContentRegistry.EMPTY, Collections.emptyMap()); this.flowFrameworkIndicesHandler = mock(FlowFrameworkIndicesHandler.class); this.flowFrameworkSettings = mock(FlowFrameworkSettings.class); @@ -68,6 +73,7 @@ public void setUp() throws Exception { flowFrameworkIndicesHandler, flowFrameworkSettings, client, + sdkClient, clusterService, xContentRegistry(), Settings.EMPTY diff --git a/src/test/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportActionTests.java b/src/test/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportActionTests.java index 4841871a..cf86be53 100644 --- a/src/test/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportActionTests.java +++ b/src/test/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportActionTests.java @@ -20,6 +20,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.core.rest.RestStatus; +import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.flowframework.common.FlowFrameworkSettings; import org.opensearch.flowframework.exception.FlowFrameworkException; import org.opensearch.flowframework.indices.FlowFrameworkIndicesHandler; @@ -31,6 +32,8 @@ import org.opensearch.flowframework.workflow.UndeployModelStep; import org.opensearch.flowframework.workflow.WorkflowData; import org.opensearch.flowframework.workflow.WorkflowStepFactory; +import org.opensearch.remote.metadata.client.SdkClient; +import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ScalingExecutorBuilder; @@ -80,6 +83,7 @@ public class DeprovisionWorkflowTransportActionTests extends OpenSearchTestCase ) ); private Client client; + private SdkClient sdkClient; private WorkflowStepFactory workflowStepFactory; private DeleteConnectorStep deleteConnectorStep; private UndeployModelStep undeployModelStep; @@ -93,6 +97,7 @@ public class DeprovisionWorkflowTransportActionTests extends OpenSearchTestCase public void setUp() throws Exception { super.setUp(); this.client = mock(Client.class); + this.sdkClient = SdkClientFactory.createSdkClient(client, NamedXContentRegistry.EMPTY, Collections.emptyMap()); ThreadPool clientThreadPool = spy(threadPool); when(client.threadPool()).thenReturn(clientThreadPool); ThreadContext threadContext = new ThreadContext(Settings.EMPTY); @@ -126,6 +131,7 @@ public void setUp() throws Exception { mock(ActionFilters.class), clientThreadPool, client, + sdkClient, workflowStepFactory, flowFrameworkIndicesHandler, flowFrameworkSettings, diff --git a/src/test/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportActionTests.java b/src/test/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportActionTests.java index d9c188fc..ec7b390a 100644 --- a/src/test/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportActionTests.java +++ b/src/test/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportActionTests.java @@ -22,6 +22,7 @@ import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.flowframework.TestHelpers; @@ -31,6 +32,8 @@ import org.opensearch.flowframework.model.WorkflowState; import org.opensearch.index.IndexNotFoundException; import org.opensearch.index.get.GetResult; +import org.opensearch.remote.metadata.client.SdkClient; +import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; @@ -60,7 +63,9 @@ public class GetWorkflowStateTransportActionTests extends OpenSearchTestCase { private GetWorkflowStateTransportAction getWorkflowStateTransportAction; private FlowFrameworkIndicesHandler flowFrameworkIndicesHandler; + private FlowFrameworkSettings flowFrameworkSettings; private Client client; + private SdkClient sdkClient; private ThreadPool threadPool; private ThreadContext threadContext; private ActionListener response; @@ -69,7 +74,9 @@ public class GetWorkflowStateTransportActionTests extends OpenSearchTestCase { @Override public void setUp() throws Exception { super.setUp(); + this.flowFrameworkSettings = mock(FlowFrameworkSettings.class); this.client = mock(Client.class); + this.sdkClient = SdkClientFactory.createSdkClient(client, NamedXContentRegistry.EMPTY, Collections.emptyMap()); this.threadPool = mock(ThreadPool.class); ClusterService clusterService = mock(ClusterService.class); ClusterSettings clusterSettings = new ClusterSettings( @@ -81,7 +88,9 @@ public void setUp() throws Exception { this.getWorkflowStateTransportAction = new GetWorkflowStateTransportAction( mock(TransportService.class), mock(ActionFilters.class), + flowFrameworkSettings, client, + sdkClient, xContentRegistry(), clusterService, Settings.EMPTY diff --git a/src/test/java/org/opensearch/flowframework/transport/GetWorkflowTransportActionTests.java b/src/test/java/org/opensearch/flowframework/transport/GetWorkflowTransportActionTests.java index 4c59206c..4314c965 100644 --- a/src/test/java/org/opensearch/flowframework/transport/GetWorkflowTransportActionTests.java +++ b/src/test/java/org/opensearch/flowframework/transport/GetWorkflowTransportActionTests.java @@ -70,6 +70,7 @@ public class GetWorkflowTransportActionTests extends OpenSearchTestCase { public void setUp() throws Exception { super.setUp(); this.client = mock(Client.class); + this.sdkClient = SdkClientFactory.createSdkClient(client, NamedXContentRegistry.EMPTY, Collections.emptyMap()); this.xContentRegistry = mock(NamedXContentRegistry.class); this.flowFrameworkIndicesHandler = mock(FlowFrameworkIndicesHandler.class); this.flowFrameworkSettings = mock(FlowFrameworkSettings.class); @@ -88,6 +89,7 @@ public void setUp() throws Exception { flowFrameworkIndicesHandler, flowFrameworkSettings, client, + sdkClient, encryptorUtils, clusterService, xContentRegistry, diff --git a/src/test/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportActionTests.java b/src/test/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportActionTests.java index 77050e83..b9e26ac3 100644 --- a/src/test/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportActionTests.java +++ b/src/test/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportActionTests.java @@ -23,6 +23,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.index.shard.ShardId; +import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.flowframework.TestHelpers; import org.opensearch.flowframework.common.FlowFrameworkSettings; @@ -36,6 +37,8 @@ import org.opensearch.flowframework.workflow.WorkflowProcessSorter; import org.opensearch.index.get.GetResult; import org.opensearch.plugins.PluginsService; +import org.opensearch.remote.metadata.client.SdkClient; +import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; @@ -65,6 +68,7 @@ public class ProvisionWorkflowTransportActionTests extends OpenSearchTestCase { private ThreadPool threadPool; private Client client; + private SdkClient sdkClient; private WorkflowProcessSorter workflowProcessSorter; private ProvisionWorkflowTransportAction provisionWorkflowTransportAction; private Template template; @@ -78,6 +82,7 @@ public void setUp() throws Exception { super.setUp(); this.threadPool = mock(ThreadPool.class); this.client = mock(Client.class); + this.sdkClient = SdkClientFactory.createSdkClient(client, NamedXContentRegistry.EMPTY, Collections.emptyMap()); this.workflowProcessSorter = mock(WorkflowProcessSorter.class); this.flowFrameworkIndicesHandler = mock(FlowFrameworkIndicesHandler.class); this.flowFrameworkSettings = mock(FlowFrameworkSettings.class); @@ -95,6 +100,7 @@ public void setUp() throws Exception { mock(ActionFilters.class), threadPool, client, + sdkClient, workflowProcessSorter, flowFrameworkIndicesHandler, flowFrameworkSettings, diff --git a/src/test/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportActionTests.java b/src/test/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportActionTests.java index edba29b1..3995ddf9 100644 --- a/src/test/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportActionTests.java +++ b/src/test/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportActionTests.java @@ -16,6 +16,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; +import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.flowframework.common.FlowFrameworkSettings; import org.opensearch.flowframework.indices.FlowFrameworkIndicesHandler; import org.opensearch.flowframework.model.ResourceCreated; @@ -28,6 +29,8 @@ import org.opensearch.flowframework.workflow.WorkflowProcessSorter; import org.opensearch.flowframework.workflow.WorkflowStepFactory; import org.opensearch.plugins.PluginsService; +import org.opensearch.remote.metadata.client.SdkClient; +import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; @@ -58,6 +61,7 @@ public class ReprovisionWorkflowTransportActionTests extends OpenSearchTestCase private ActionFilters actionFilters; private ThreadPool threadPool; private Client client; + private SdkClient sdkClient; private WorkflowStepFactory workflowStepFactory; private WorkflowProcessSorter workflowProcessSorter; private FlowFrameworkIndicesHandler flowFrameworkIndicesHandler; @@ -75,6 +79,7 @@ public void setUp() throws Exception { this.actionFilters = mock(ActionFilters.class); this.threadPool = mock(ThreadPool.class); this.client = mock(Client.class); + this.sdkClient = SdkClientFactory.createSdkClient(client, NamedXContentRegistry.EMPTY, Collections.emptyMap()); this.workflowStepFactory = mock(WorkflowStepFactory.class); this.workflowProcessSorter = mock(WorkflowProcessSorter.class); this.flowFrameworkIndicesHandler = mock(FlowFrameworkIndicesHandler.class); @@ -94,6 +99,7 @@ public void setUp() throws Exception { actionFilters, threadPool, client, + sdkClient, workflowStepFactory, workflowProcessSorter, flowFrameworkIndicesHandler,