Skip to content

Commit

Permalink
Fix max workflows setting test
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Dec 9, 2023
1 parent 25363f3 commit f428ead
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

/**
* Abstract class to handle search request.
* @param <T> The type to search
*/
public abstract class AbstractSearchWorkflowAction<T extends ToXContentObject> extends BaseRestHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/
public class NoOpStep implements WorkflowStep {

/** Instantiate this class */
public NoOpStep() {}

/** The name of this step, used as a key in the template and the {@link WorkflowStepFactory} */
public static final String NAME = "noop";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
import static org.opensearch.flowframework.common.FlowFrameworkSettings.MAX_WORKFLOWS;
import static org.opensearch.flowframework.common.FlowFrameworkSettings.WORKFLOW_REQUEST_TIMEOUT;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
Expand All @@ -70,7 +70,7 @@ public void setUp() throws Exception {
super.setUp();
threadPool = mock(ThreadPool.class);
settings = Settings.builder()
.put("plugins.flow_framework.max_workflows.", 2)
.put("plugins.flow_framework.max_workflows", 2)
.put("plugins.flow_framework.request_timeout", TimeValue.timeValueSeconds(10))
.build();
this.flowFrameworkIndicesHandler = mock(FlowFrameworkIndicesHandler.class);
Expand Down Expand Up @@ -196,11 +196,10 @@ public void testMaxWorkflow() {
createWorkflowTransportAction.doExecute(mock(Task.class), workflowRequest, listener);
ArgumentCaptor<Exception> exceptionCaptor = ArgumentCaptor.forClass(Exception.class);
verify(listener, times(1)).onFailure(exceptionCaptor.capture());
assertEquals(("Maximum workflows limit reached 1000"), exceptionCaptor.getValue().getMessage());
assertEquals(("Maximum workflows limit reached 2"), exceptionCaptor.getValue().getMessage());
}

public void testMaxWorkflowWithNoIndex() {
@SuppressWarnings("unchecked")
ActionListener<Boolean> listener = new ActionListener<Boolean>() {
@Override
public void onResponse(Boolean booleanResponse) {
Expand Down

0 comments on commit f428ead

Please sign in to comment.