@Test
void beanWithValidationError() {

    request.method = HTTPMethod.POST;
    request.contentType = ContentType.APPLICATION_JSON;
    request.body = Strings.bytes("{\"big_decimal_field\": 1}");
    assertThatThrownBy(() -> request.bean(TestBean.class))
            .isInstanceOf(BadRequestException.class)
            .satisfies(exception -> assertThat(((BadRequestException) exception).errorCode()).isEqualTo("VALIDATION_ERROR"));
}