@Test public void extractLimitShouldReturnUnlimitedWhenNotInParameters() { Request request = mock(Request.class); when(request.queryParams("limit")) .thenReturn(null); Limit limit = ParametersExtractor.extractLimit(request); assertThat(limit).isEqualTo(Limit.unlimited()); }
public static Limit extractLimit(Request request) { return Limit.from(extractPositiveInteger(request, LIMIT_PARAMETER_NAME) .map(value -> assertNotZero(value, LIMIT_PARAMETER_NAME))); }
ParametersExtractor { public static Limit extractLimit(Request request) { return Limit.from(extractPositiveInteger(request, LIMIT_PARAMETER_NAME) .map(value -> assertNotZero(value, LIMIT_PARAMETER_NAME))); } }
ParametersExtractor { public static Limit extractLimit(Request request) { return Limit.from(extractPositiveInteger(request, LIMIT_PARAMETER_NAME) .map(value -> assertNotZero(value, LIMIT_PARAMETER_NAME))); }  }
ParametersExtractor { public static Limit extractLimit(Request request) { return Limit.from(extractPositiveInteger(request, LIMIT_PARAMETER_NAME) .map(value -> assertNotZero(value, LIMIT_PARAMETER_NAME))); }  static Limit extractLimit(Request request); static Offset extractOffset(Request request); static Optional<Double> extractPositiveDouble(Request request, String parameterName); static Optional<Integer> extractPositiveInteger(Request request, String parameterName); }
ParametersExtractor { public static Limit extractLimit(Request request) { return Limit.from(extractPositiveInteger(request, LIMIT_PARAMETER_NAME) .map(value -> assertNotZero(value, LIMIT_PARAMETER_NAME))); }  static Limit extractLimit(Request request); static Offset extractOffset(Request request); static Optional<Double> extractPositiveDouble(Request request, String parameterName); static Optional<Integer> extractPositiveInteger(Request request, String parameterName); static final String LIMIT_PARAMETER_NAME; static final String OFFSET_PARAMETER_NAME; }