Skip to content

Commit

Permalink
Fix compiler warnings (#270)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis authored Dec 12, 2023
1 parent 25363f3 commit 59afca7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ public void setUp() throws Exception {
}

public void testParseFeature() throws IOException {
ResourceCreated ResourceCreated = new ResourceCreated("A", "B");
assertEquals(ResourceCreated.workflowStepName(), "A");
assertEquals(ResourceCreated.resourceId(), "B");
ResourceCreated resourceCreated = new ResourceCreated("A", "B");
assertEquals(resourceCreated.workflowStepName(), "A");
assertEquals(resourceCreated.resourceId(), "B");

String expectedJson = "{\"workflow_step_name\":\"A\",\"resource_id\":\"B\"}";
String json = TemplateTestJsonUtil.parseToJson(ResourceCreated);
String json = TemplateTestJsonUtil.parseToJson(resourceCreated);
assertEquals(expectedJson, json);

ResourceCreated ResourceCreatedTwo = ResourceCreated.parse(TemplateTestJsonUtil.jsonToParser(json));
assertEquals("A", ResourceCreatedTwo.workflowStepName());
assertEquals("B", ResourceCreatedTwo.resourceId());
ResourceCreated resourceCreatedTwo = ResourceCreated.parse(TemplateTestJsonUtil.jsonToParser(json));
assertEquals("A", resourceCreatedTwo.workflowStepName());
assertEquals("B", resourceCreatedTwo.resourceId());
}

public void testExceptions() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.opensearch.flowframework.model.Workflow;
import org.opensearch.flowframework.model.WorkflowEdge;
import org.opensearch.flowframework.model.WorkflowNode;
import org.opensearch.flowframework.util.ParseUtils;
import org.opensearch.flowframework.workflow.WorkflowProcessSorter;
import org.opensearch.flowframework.workflow.WorkflowStepFactory;
import org.opensearch.tasks.Task;
Expand All @@ -44,8 +43,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 @@ -61,8 +60,6 @@ public class CreateWorkflowTransportActionTests extends OpenSearchTestCase {
private Template template;
private Client client = mock(Client.class);
private ThreadPool threadPool;
private ParseUtils parseUtils;
private ThreadContext threadContext;
private Settings settings;

@Override
Expand Down Expand Up @@ -200,7 +197,6 @@ public void testMaxWorkflow() {
}

public void testMaxWorkflowWithNoIndex() {
@SuppressWarnings("unchecked")
ActionListener<Boolean> listener = new ActionListener<Boolean>() {
@Override
public void onResponse(Boolean booleanResponse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.flowframework.TestHelpers;
import org.opensearch.flowframework.indices.FlowFrameworkIndicesHandler;
import org.opensearch.flowframework.model.WorkflowState;
import org.opensearch.tasks.Task;
import org.opensearch.test.OpenSearchTestCase;
Expand All @@ -40,18 +39,14 @@
public class GetWorkflowTransportActionTests extends OpenSearchTestCase {

private GetWorkflowTransportAction getWorkflowTransportAction;
private FlowFrameworkIndicesHandler flowFrameworkIndicesHandler;
private Client client;
private ThreadPool threadPool;
private ThreadContext threadContext;
private ActionListener<GetWorkflowResponse> response;
private Task task;

@Override
public void setUp() throws Exception {
super.setUp();
this.client = mock(Client.class);
this.threadPool = mock(ThreadPool.class);
this.getWorkflowTransportAction = new GetWorkflowTransportAction(
mock(TransportService.class),
mock(ActionFilters.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.concurrent.ThreadContext;
import org.opensearch.core.action.ActionListener;
import org.opensearch.flowframework.indices.FlowFrameworkIndicesHandler;
import org.opensearch.tasks.Task;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.TransportService;

import org.mockito.ArgumentCaptor;

import static org.mockito.Mockito.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
Expand All @@ -33,10 +32,8 @@
public class SearchWorkflowTransportActionTests extends OpenSearchTestCase {

private SearchWorkflowTransportAction searchWorkflowTransportAction;
private FlowFrameworkIndicesHandler flowFrameworkIndicesHandler;
private Client client;
private ThreadPool threadPool;
private ThreadContext threadContext;

@Override
public void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@SuppressWarnings("deprecation")
public class CreateIndexStepTests extends OpenSearchTestCase {

private static final String META = "_meta";
private static final String SCHEMA_VERSION_FIELD = "schemaVersion";

private WorkflowData inputData = WorkflowData.EMPTY;
private Client client;
private AdminClient adminClient;
Expand Down

0 comments on commit 59afca7

Please sign in to comment.