void validateInput(@Valid Input input){
      // do something
    }
@Test
  void whenInputIsInvalid_thenThrowsException(){
    Input input = new Input();
    input.setNumberBetweenOneAndTen(0);
    input.setIpAddress("invalid");

    assertThrows(ConstraintViolationException.class, () -> {
      service.validateInput(input);
    });
  }