use of org.opensearch.common.collect.MapBuilder in project OpenSearch by opensearch-project.
the class RestTasksActionTests method testConsumesParameters.
public void testConsumesParameters() throws Exception {
RestTasksAction action = new RestTasksAction(() -> DiscoveryNodes.EMPTY_NODES);
FakeRestRequest fakeRestRequest = new FakeRestRequest.Builder(NamedXContentRegistry.EMPTY).withParams(MapBuilder.<String, String>newMapBuilder().put("parent_task_id", "the node:3").put("nodes", "node1,node2").put("actions", "*").map()).build();
FakeRestChannel fakeRestChannel = new FakeRestChannel(fakeRestRequest, false, 1);
try (NoOpNodeClient nodeClient = buildNodeClient()) {
action.handleRequest(fakeRestRequest, fakeRestChannel, nodeClient);
}
assertThat(fakeRestChannel.errors().get(), is(0));
assertThat(fakeRestChannel.responses().get(), is(1));
}
Aggregations