@Test public void extractOffsetShouldReturnNoneWhenPresentInParametersButEmpty() { Request request = mock(Request.class); when(request.queryParams("offset")) .thenReturn(""); Offset offset = ParametersExtractor.extractOffset(request); assertThat(offset).isEqualTo(Offset.none()); }
public static Offset extractOffset(Request request) { return Offset.from(extractPositiveInteger(request, OFFSET_PARAMETER_NAME)); }
ParametersExtractor { public static Offset extractOffset(Request request) { return Offset.from(extractPositiveInteger(request, OFFSET_PARAMETER_NAME)); } }
ParametersExtractor { public static Offset extractOffset(Request request) { return Offset.from(extractPositiveInteger(request, OFFSET_PARAMETER_NAME)); }  }
ParametersExtractor { public static Offset extractOffset(Request request) { return Offset.from(extractPositiveInteger(request, OFFSET_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 Offset extractOffset(Request request) { return Offset.from(extractPositiveInteger(request, OFFSET_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; }