public MessagesRequestSpec simpleQueryParamsToFullRequestSpecification(final String query,
                                                                           final Set<String> streams,
                                                                           final String timerangeKeyword,
                                                                           final List<String> fields,
                                                                           final String sort,
                                                                           final SortSpec.Direction sortOrder,
                                                                           final int from,
                                                                           final int size) {

        return new MessagesRequestSpec(query,
                streams,
                timerangeParser.parseTimeRange(timerangeKeyword),
                sort,
                sortOrder,
                from,
                size,
                fields);
    }
@Test
    void createsProperRequestSpec() {
        doReturn(KeywordRange.create("last 1 day", "UTC")).when(timerangeParser).parseTimeRange("1d");
        final AggregationRequestSpec aggregationRequestSpec = toTest.simpleQueryParamsToFullRequestSpecification("http_method:GET",
                Set.of("000000000000000000000001"),
                "1d",
                List.of("http_method", "controller"),
                List.of("avg:took_ms"));

        assertThat(aggregationRequestSpec).isEqualTo(new AggregationRequestSpec(
                        "http_method:GET",
                        Set.of("000000000000000000000001"),
                        KeywordRange.create("last 1 day", "UTC"),
                        List.of(new Grouping("http_method"), new Grouping("controller")),
                        List.of(new Metric("avg", "took_ms"))

                )
        );
    }