Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
Signed-off-by: owaiskazi19 <[email protected]>
  • Loading branch information
owaiskazi19 committed Jan 4, 2024
1 parent c952493 commit cfc83d9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import org.opensearch.client.Client;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.rest.RestStatus;
import org.opensearch.flowframework.common.FlowFrameworkSettings;
import org.opensearch.flowframework.exception.FlowFrameworkException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
package org.opensearch.flowframework.common;

import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -28,8 +36,8 @@ public void setUp() throws Exception {

settings = Settings.builder().build();
final Set<Setting<?>> settingsSet = Stream.concat(
ClusterSettings.BUILT_IN_CLUSTER_SETTINGS.stream(),
Stream.of(FlowFrameworkSettings.FLOW_FRAMEWORK_ENABLED, FlowFrameworkSettings.MAX_GET_TASK_REQUEST_RETRY)
ClusterSettings.BUILT_IN_CLUSTER_SETTINGS.stream(),
Stream.of(FlowFrameworkSettings.FLOW_FRAMEWORK_ENABLED, FlowFrameworkSettings.MAX_GET_TASK_REQUEST_RETRY)
).collect(Collectors.toSet());
clusterSettings = new ClusterSettings(settings, settingsSet);
clusterService = mock(ClusterService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public void setUp() throws Exception {
invalidWorkflowStepJson =
"{\"workflow_step_1\":{\"bad_field\":[\"input_1\",\"input_2\"],\"outputs\":[\"output_1\"]},\"workflow_step_2\":{\"inputs\":[\"input_1\",\"input_2\",\"input_3\"],\"outputs\":[\"output_1\",\"output_2\",\"output_3\"]}}";


flowFrameworkSettings = mock(FlowFrameworkSettings.class);
when(flowFrameworkSettings.isFlowFrameworkEnabled()).thenReturn(true);
}
Expand Down Expand Up @@ -101,7 +100,7 @@ public void testWorkflowStepFactoryHasValidators() throws IOException {
client,
mlClient,
flowFrameworkIndicesHandler,
flowFrameworkSettings
flowFrameworkSettings
);

// Read in workflow-steps.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public void setUp() throws Exception {

flowFrameworkSettings = mock(FlowFrameworkSettings.class);
when(flowFrameworkSettings.isFlowFrameworkEnabled()).thenReturn(true);
when(flowFrameworkSettings.getMaxRetry()).thenReturn(5);

testThreadPool = new TestThreadPool(
DeployModelStepTests.class.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public void setUp() throws Exception {

flowFrameworkSettings = mock(FlowFrameworkSettings.class);
when(flowFrameworkSettings.isFlowFrameworkEnabled()).thenReturn(true);
when(flowFrameworkSettings.getMaxRetry()).thenReturn(5);

testThreadPool = new TestThreadPool(
RegisterLocalModelStepTests.class.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static void setup() throws IOException {
client,
mlClient,
flowFrameworkIndicesHandler,
flowFrameworkSettings
flowFrameworkSettings
);
workflowProcessSorter = new WorkflowProcessSorter(factory, testThreadPool, clusterService, client, settings);
validator = WorkflowValidator.parse("mappings/workflow-steps.json");
Expand Down

0 comments on commit cfc83d9

Please sign in to comment.