@TestFactory
Stream<DynamicTest>
    should_CallConsumerWithDescSortDirection_When_MapDoesContainsDescSortDirection() {

  Iterator<String> testCases = Arrays.asList("desc", "DESC", "Desc", "desC", "DeSc").iterator();
  ThrowingConsumer<String> test =
      desc -> {
        MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
        map.put(QueryHelper.SORT_BY, Collections.singletonList("sort-by-value"));
        map.put(QueryHelper.ORDER_DIRECTION, Collections.singletonList(desc));
        MockBiConsumer consumer = mock(MockBiConsumer.class);
        applyAndRemoveSortingParams(map, consumer);
        verify(consumer).accept(any(), eq(SortDirection.DESCENDING));
        verifyNoMoreInteractions(consumer);
      };
  return DynamicTest.stream(testCases, s -> "Order by: " + s, test);
}