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 usesProperDefaults() {
        AggregationRequestSpec aggregationRequestSpec = toTest.simpleQueryParamsToFullRequestSpecification(null,
                null,
                null,
                List.of("http_method"),
                null);

        assertThat(aggregationRequestSpec).isEqualTo(new AggregationRequestSpec(
                        "*",
                        Set.of(),
                        DEFAULT_TIMERANGE,
                        List.of(new Grouping("http_method")),
                        List.of(new Metric("count", null))
                )
        );

        aggregationRequestSpec = toTest.simpleQueryParamsToFullRequestSpecification(null,
                null,
                null,
                List.of("http_method"),
                List.of());

        assertThat(aggregationRequestSpec).isEqualTo(new AggregationRequestSpec(
                        "*",
                        Set.of(),
                        DEFAULT_TIMERANGE,
                        List.of(new Grouping("http_method")),
                        List.of(new Metric("count", null))

                )
        );

        final MessagesRequestSpec messagesRequestSpec = toTest.simpleQueryParamsToFullRequestSpecification(null, null, null, null, null, null, 0, 10);
        assertThat(messagesRequestSpec).isEqualTo(new MessagesRequestSpec(
                        "*",
                        Set.of(),
                        DEFAULT_TIMERANGE,
                        DEFAULT_SORT,
                        DEFAULT_SORT_ORDER,
                        0,
                        10,
                        DEFAULT_FIELDS


                )
        );
    }