PathParams { public void put(String name, String value) { if (value.isEmpty()) throw new BadRequestException(format("path param must not be empty, name={}, value={}", name, value), "INVALID_HTTP_REQUEST"); try { params.put(name, Encodings.decodeURIComponent(value)); } catch (IllegalArgumentException e) { throw new BadRequestException(e.getMessage(), "INVALID_HTTP_REQUEST", e); } }  void put(String name, String value); String get(String name);  }
@Test void putEmptyPathParam() { assertThatThrownBy(() -> pathParams.put("id", "")) .isInstanceOf(BadRequestException.class) .hasMessageContaining("path param must not be empty"); assertThatThrownBy(() -> pathParams.put("id", "invalidURIValue%")) .isInstanceOf(BadRequestException.class); }