All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jinahya.assertj.validation.package-info Maven / Gradle / Ivy

/**
 * Defines AssertJ classes for fluently verifying objects and values
 * against Jakarta Bean-Validation.
 * 
 * class User {
 *     {@literal @}NotBlank String name = "UNKNOWN";
 *     {@literal @}PositiveOrZero int age;
 * }
 *
 * assertBean(new User()).isValid();
 * assertThat(bean(new User())).isValid(); // equivalent
 *
 * assertBean(new User()).hasValidProprty("name");
 * assertThat(bean(new User())).hasValidProperty("age"); // equivalent
 *
 * assertBeanProperty(null).isValidFor(User.class, "name");         // fail
 * assertBeanProperty("").isValidFor(User.class, "name");           // fail
 * assertBeanProperty(" ").isValidFor(User.class, "name");          // fail
 * assertThat(beanProperty("Jane")).isValidFor(User.class, "name"); // succeed
 *
 * assertThat(beanProperty(-1)).isValidFor(User.class, "age"); // fail
 * assertBeanProperty(0).isValidFor(User.class, "age");        // succeed
 * assertBeanProperty(1).isValidFor(User.class, "age");        // succeed
 * 
* * @author Jin Kwon <onacit_at_gmail.com> */ package com.github.jinahya.assertj.validation; /*- * #%L * assertj-bean-validation * %% * Copyright (C) 2021 Jinahya, Inc. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */




© 2015 - 2025 Weber Informatics LLC | Privacy Policy