We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
공식문서에 존재하는 Product의 예시에서,
@Value public class Product { @Min(1) long id; @NotBlank String productName; @Max(100000) long price; @Size(min = 3) List<@NotBlank String> options; @Past Instant createdAt; }
아래와 같이 @Min(1)을 위반하는 값으로 커스터마이징 불가능 한 것으로 보입니다.
@Min(1)
@Test void test() { // given FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .objectIntrospector(ConstructorPropertiesArbitraryIntrospector.INSTANCE) .plugin(new JakartaValidationPlugin()) .build(); // when Product actual = fixtureMonkey.giveMeBuilder(Product.class) .set("id", -1L) // IllegalArgumentException expected .sample(); }
혹시 커스터마이징 하는 프로퍼티에 대해서만 Validation을 무시하는 다른 API를 제공하고 있나요?
The text was updated successfully, but these errors were encountered:
@kiwonseo 아래처럼 validOnly(false) 로 지정하면 생성된 객체 jakarata validation 을 실행하지 않고 skip 합니다
validOnly(false)
Product actual = fixtureMonkey.giveMeBuilder(Product.class) .set("id", -1L) // IllegalArgumentException expected .validOnly(false) .sample(); }
의도적으로 Validation 을 통과하지 못하는 객체를 만들때 사용하시면 됩니다
Sorry, something went wrong.
답변 감사드립니다!
No branches or pull requests
Describe your question
공식문서에 존재하는 Product의 예시에서,
아래와 같이
@Min(1)
을 위반하는 값으로 커스터마이징 불가능 한 것으로 보입니다.혹시 커스터마이징 하는 프로퍼티에 대해서만 Validation을 무시하는 다른 API를 제공하고 있나요?
The text was updated successfully, but these errors were encountered: