BAEL-20262: Migrate javaxval module to the com.baeldung package

This commit is contained in:
Krzysztof Woyke 2019-12-20 12:36:57 +01:00
parent 98bdc464da
commit 015d9b3f81
51 changed files with 103 additions and 103 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.beanvalidation;
package com.baeldung.javaxval.beanvalidation;
import java.time.LocalDate;
import java.util.List;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.bigdecimal;
package com.baeldung.javaxval.bigdecimal;
import java.math.BigDecimal;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.container.validation;
package com.baeldung.javaxval.container.validation;
import java.util.List;
import java.util.Optional;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.container.validation;
package com.baeldung.javaxval.container.validation;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.container.validation;
package com.baeldung.javaxval.container.validation;
public class Profile {
private String companyName;

View File

@ -1,10 +1,10 @@
package org.baeldung.javaxval.container.validation.valueextractors;
package com.baeldung.javaxval.container.validation.valueextractors;
import javax.validation.valueextraction.ExtractedValue;
import javax.validation.valueextraction.UnwrapByDefault;
import javax.validation.valueextraction.ValueExtractor;
import org.baeldung.javaxval.container.validation.Profile;
import com.baeldung.javaxval.container.validation.Profile;
@UnwrapByDefault
public class ProfileValueExtractor implements ValueExtractor<@ExtractedValue(type = String.class) Profile> {

View File

@ -1,12 +1,12 @@
package org.baeldung.javaxval.enums;
package com.baeldung.javaxval.enums;
import java.util.Arrays;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.baeldung.javaxval.enums.constraints.CustomerTypeSubset;
import org.baeldung.javaxval.enums.demo.CustomerType;
import com.baeldung.javaxval.enums.constraints.CustomerTypeSubset;
import com.baeldung.javaxval.enums.demo.CustomerType;
public class CustomerTypeSubSetValidator implements ConstraintValidator<CustomerTypeSubset, CustomerType> {
private CustomerType[] subset;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums;
package com.baeldung.javaxval.enums;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -7,7 +7,7 @@ import java.util.regex.PatternSyntaxException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.baeldung.javaxval.enums.constraints.EnumNamePattern;
import com.baeldung.javaxval.enums.constraints.EnumNamePattern;
public class EnumNamePatternValidator implements ConstraintValidator<EnumNamePattern, Enum<?>> {
private Pattern pattern;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums;
package com.baeldung.javaxval.enums;
import java.lang.annotation.Annotation;
import java.util.Arrays;

View File

@ -1,7 +1,7 @@
package org.baeldung.javaxval.enums;
package com.baeldung.javaxval.enums;
import org.baeldung.javaxval.enums.constraints.CustomerTypeSubset;
import org.baeldung.javaxval.enums.demo.CustomerType;
import com.baeldung.javaxval.enums.constraints.CustomerTypeSubset;
import com.baeldung.javaxval.enums.demo.CustomerType;
public class InheritedCustomerTypeSubSetValidator extends EnumSubSetValidator<CustomerTypeSubset, CustomerType> {
@Override

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums;
package com.baeldung.javaxval.enums;
import java.util.List;
import java.util.stream.Collectors;
@ -7,7 +7,7 @@ import java.util.stream.Stream;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.baeldung.javaxval.enums.constraints.ValueOfEnum;
import com.baeldung.javaxval.enums.constraints.ValueOfEnum;
public class ValueOfEnumValidator implements ConstraintValidator<ValueOfEnum, CharSequence> {
private List<String> acceptedValues;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums.constraints;
package com.baeldung.javaxval.enums.constraints;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
@ -15,8 +15,8 @@ import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import org.baeldung.javaxval.enums.CustomerTypeSubSetValidator;
import org.baeldung.javaxval.enums.demo.CustomerType;
import com.baeldung.javaxval.enums.CustomerTypeSubSetValidator;
import com.baeldung.javaxval.enums.demo.CustomerType;
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums.constraints;
package com.baeldung.javaxval.enums.constraints;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
@ -15,7 +15,7 @@ import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import org.baeldung.javaxval.enums.EnumNamePatternValidator;
import com.baeldung.javaxval.enums.EnumNamePatternValidator;
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums.constraints;
package com.baeldung.javaxval.enums.constraints;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
@ -15,7 +15,7 @@ import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import org.baeldung.javaxval.enums.ValueOfEnumValidator;
import com.baeldung.javaxval.enums.ValueOfEnumValidator;
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)

View File

@ -1,10 +1,10 @@
package org.baeldung.javaxval.enums.demo;
package com.baeldung.javaxval.enums.demo;
import javax.validation.constraints.NotNull;
import org.baeldung.javaxval.enums.constraints.CustomerTypeSubset;
import org.baeldung.javaxval.enums.constraints.EnumNamePattern;
import org.baeldung.javaxval.enums.constraints.ValueOfEnum;
import com.baeldung.javaxval.enums.constraints.CustomerTypeSubset;
import com.baeldung.javaxval.enums.constraints.EnumNamePattern;
import com.baeldung.javaxval.enums.constraints.ValueOfEnum;
public class Customer {
@ValueOfEnum(enumClass = CustomerType.class)

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums.demo;
package com.baeldung.javaxval.enums.demo;
public enum CustomerType {
NEW, OLD, DEFAULT

View File

@ -1,9 +1,9 @@
package org.baeldung.javaxval.javabeanconstraints.application;
package com.baeldung.javaxval.javabeanconstraints.application;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.javabeanconstraints.entities.UserNotBlank;
import com.baeldung.javaxval.javabeanconstraints.entities.UserNotBlank;
public class Application {

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.javabeanconstraints.entities;
package com.baeldung.javaxval.javabeanconstraints.entities;
import javax.validation.constraints.NotBlank;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.javabeanconstraints.entities;
package com.baeldung.javaxval.javabeanconstraints.entities;
import javax.validation.constraints.NotEmpty;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.javabeanconstraints.entities;
package com.baeldung.javaxval.javabeanconstraints.entities;
import javax.validation.constraints.NotNull;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.messageinterpolator;
package com.baeldung.javaxval.messageinterpolator;
import javax.validation.constraints.Email;
import javax.validation.constraints.Min;

View File

@ -1,9 +1,9 @@
package org.baeldung.javaxval.methodvalidation;
package com.baeldung.javaxval.methodvalidation;
import java.time.LocalDate;
import org.baeldung.javaxval.methodvalidation.model.Customer;
import org.baeldung.javaxval.methodvalidation.model.Reservation;
import com.baeldung.javaxval.methodvalidation.model.Customer;
import com.baeldung.javaxval.methodvalidation.model.Reservation;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -12,7 +12,7 @@ import org.springframework.context.annotation.Scope;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;
@Configuration
@ComponentScan({ "org.baeldung.javaxval.methodvalidation.model" })
@ComponentScan({ "com.baeldung.javaxval.methodvalidation.model" })
public class MethodValidationConfig {
@Bean

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.methodvalidation.constraints;
package com.baeldung.javaxval.methodvalidation.constraints;
import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.methodvalidation.constraints;
package com.baeldung.javaxval.methodvalidation.constraints;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.METHOD;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.methodvalidation.constraints;
package com.baeldung.javaxval.methodvalidation.constraints;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.METHOD;

View File

@ -1,11 +1,11 @@
package org.baeldung.javaxval.methodvalidation.constraints;
package com.baeldung.javaxval.methodvalidation.constraints;
import java.time.LocalDate;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.baeldung.javaxval.methodvalidation.model.Reservation;
import com.baeldung.javaxval.methodvalidation.model.Reservation;
public class ValidReservationValidator implements ConstraintValidator<ValidReservation, Reservation> {

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.methodvalidation.model;
package com.baeldung.javaxval.methodvalidation.model;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

View File

@ -1,12 +1,12 @@
package org.baeldung.javaxval.methodvalidation.model;
package com.baeldung.javaxval.methodvalidation.model;
import java.time.LocalDate;
import javax.validation.Valid;
import javax.validation.constraints.Positive;
import org.baeldung.javaxval.methodvalidation.constraints.ConsistentDateParameters;
import org.baeldung.javaxval.methodvalidation.constraints.ValidReservation;
import com.baeldung.javaxval.methodvalidation.constraints.ValidReservation;
import com.baeldung.javaxval.methodvalidation.constraints.ConsistentDateParameters;
import org.springframework.validation.annotation.Validated;
@Validated

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.methodvalidation.model;
package com.baeldung.javaxval.methodvalidation.model;
import java.time.LocalDate;
import java.util.List;
@ -9,7 +9,7 @@ import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.baeldung.javaxval.methodvalidation.constraints.ConsistentDateParameters;
import com.baeldung.javaxval.methodvalidation.constraints.ConsistentDateParameters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Controller;

View File

@ -0,0 +1,5 @@
package com.baeldung.javaxval.validationgroup;
public interface AdvanceInfo {
}

View File

@ -0,0 +1,5 @@
package com.baeldung.javaxval.validationgroup;
public interface BasicInfo {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.validationgroup;
package com.baeldung.javaxval.validationgroup;
import javax.validation.GroupSequence;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.validationgroup;
package com.baeldung.javaxval.validationgroup;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;

View File

@ -1,5 +0,0 @@
package org.baeldung.javaxval.validationgroup;
public interface AdvanceInfo {
}

View File

@ -1,5 +0,0 @@
package org.baeldung.javaxval.validationgroup;
public interface BasicInfo {
}

View File

@ -1 +1 @@
org.baeldung.javaxval.container.validation.valueextractors.ProfileValueExtractor
com.baeldung.javaxval.container.validation.valueextractors.ProfileValueExtractor

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval;
package com.baeldung.javaxval;
import java.util.Locale;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.beanvalidation;
package com.baeldung.javaxval.beanvalidation;
import static org.junit.Assert.assertEquals;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.bigdecimal;
package com.baeldung.javaxval.bigdecimal;
import static org.assertj.core.api.Assertions.assertThat;
@ -9,7 +9,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.LocaleAwareUnitTest;
import com.baeldung.javaxval.LocaleAwareUnitTest;
import org.junit.BeforeClass;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.container.validation;
package com.baeldung.javaxval.container.validation;
import static org.junit.Assert.assertEquals;
@ -11,7 +11,7 @@ import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import org.baeldung.javaxval.container.validation.valueextractors.ProfileValueExtractor;
import com.baeldung.javaxval.container.validation.valueextractors.ProfileValueExtractor;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums;
package com.baeldung.javaxval.enums;
import static org.assertj.core.api.Assertions.assertThat;
@ -8,9 +8,9 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.enums.demo.Customer;
import org.baeldung.javaxval.enums.demo.CustomerType;
import org.baeldung.javaxval.enums.demo.CustomerUnitTest;
import com.baeldung.javaxval.enums.demo.CustomerUnitTest;
import com.baeldung.javaxval.enums.demo.Customer;
import com.baeldung.javaxval.enums.demo.CustomerType;
import org.junit.BeforeClass;
import org.junit.Test;

View File

@ -1,8 +1,8 @@
package org.baeldung.javaxval.enums;
package com.baeldung.javaxval.enums;
import static org.assertj.core.api.Assertions.assertThat;
import static org.baeldung.javaxval.enums.demo.CustomerType.DEFAULT;
import static org.baeldung.javaxval.enums.demo.CustomerType.OLD;
import static com.baeldung.javaxval.enums.demo.CustomerType.DEFAULT;
import static com.baeldung.javaxval.enums.demo.CustomerType.OLD;
import java.util.Set;
@ -10,8 +10,8 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.enums.demo.Customer;
import org.baeldung.javaxval.enums.demo.CustomerUnitTest;
import com.baeldung.javaxval.enums.demo.CustomerUnitTest;
import com.baeldung.javaxval.enums.demo.Customer;
import org.junit.BeforeClass;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums;
package com.baeldung.javaxval.enums;
import static org.assertj.core.api.Assertions.assertThat;
@ -8,8 +8,8 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.enums.demo.Customer;
import org.baeldung.javaxval.enums.demo.CustomerUnitTest;
import com.baeldung.javaxval.enums.demo.CustomerUnitTest;
import com.baeldung.javaxval.enums.demo.Customer;
import org.junit.BeforeClass;
import org.junit.Test;
@ -47,6 +47,6 @@ public class ValueOfEnumValidatorUnitTest {
assertThat(violations.size()).isEqualTo(1);
assertThat(violations).anyMatch(CustomerUnitTest.havingPropertyPath("customerTypeString")
.and(CustomerUnitTest.havingMessage("must be any of enum class org.baeldung.javaxval.enums.demo.CustomerType")));
.and(CustomerUnitTest.havingMessage("must be any of enum class com.baeldung.javaxval.enums.demo.CustomerType")));
}
}

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.enums.demo;
package com.baeldung.javaxval.enums.demo;
import static org.assertj.core.api.Assertions.assertThat;
@ -9,7 +9,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.LocaleAwareUnitTest;
import com.baeldung.javaxval.LocaleAwareUnitTest;
import org.junit.BeforeClass;
import org.junit.Test;
@ -50,7 +50,7 @@ public class CustomerUnitTest extends LocaleAwareUnitTest {
Set<ConstraintViolation<Customer>> violations = validator.validate(customer);
assertThat(violations.size()).isEqualTo(3);
assertThat(violations).anyMatch(havingPropertyPath("customerTypeString").and(havingMessage("must be any of enum class org.baeldung.javaxval.enums.demo.CustomerType")));
assertThat(violations).anyMatch(havingPropertyPath("customerTypeString").and(havingMessage("must be any of enum class com.baeldung.javaxval.enums.demo.CustomerType")));
assertThat(violations).anyMatch(havingPropertyPath("customerTypeOfSubset").and(havingMessage("must be any of [NEW, OLD]")));
assertThat(violations).anyMatch(havingPropertyPath("customerTypeMatchesPattern").and(havingMessage("must match \"NEW|DEFAULT\"")));
}

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.javabeanconstraints.test;
package com.baeldung.javaxval.javabeanconstraints.test;
import static org.assertj.core.api.Assertions.assertThat;
@ -8,7 +8,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.javabeanconstraints.entities.UserNotBlank;
import com.baeldung.javaxval.javabeanconstraints.entities.UserNotBlank;
import org.junit.BeforeClass;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.javabeanconstraints.test;
package com.baeldung.javaxval.javabeanconstraints.test;
import static org.assertj.core.api.Assertions.assertThat;
@ -8,7 +8,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.javabeanconstraints.entities.UserNotEmpty;
import com.baeldung.javaxval.javabeanconstraints.entities.UserNotEmpty;
import org.junit.BeforeClass;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.javabeanconstraints.test;
package com.baeldung.javaxval.javabeanconstraints.test;
import static org.assertj.core.api.Assertions.assertThat;
@ -8,7 +8,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.javabeanconstraints.entities.UserNotNull;
import com.baeldung.javaxval.javabeanconstraints.entities.UserNotNull;
import org.junit.BeforeClass;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.messageinterpolator;
package com.baeldung.javaxval.messageinterpolator;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@ -1,13 +1,13 @@
package org.baeldung.javaxval.methodvalidation;
package com.baeldung.javaxval.methodvalidation;
import java.time.LocalDate;
import java.util.List;
import javax.validation.ConstraintViolationException;
import org.baeldung.javaxval.methodvalidation.model.Customer;
import org.baeldung.javaxval.methodvalidation.model.Reservation;
import org.baeldung.javaxval.methodvalidation.model.ReservationManagement;
import com.baeldung.javaxval.methodvalidation.model.Customer;
import com.baeldung.javaxval.methodvalidation.model.Reservation;
import com.baeldung.javaxval.methodvalidation.model.ReservationManagement;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.methodvalidation;
package com.baeldung.javaxval.methodvalidation;
import static org.junit.Assert.assertEquals;
@ -13,9 +13,9 @@ import javax.validation.Validation;
import javax.validation.ValidatorFactory;
import javax.validation.executable.ExecutableValidator;
import org.baeldung.javaxval.methodvalidation.model.Customer;
import org.baeldung.javaxval.methodvalidation.model.Reservation;
import org.baeldung.javaxval.methodvalidation.model.ReservationManagement;
import com.baeldung.javaxval.methodvalidation.model.Customer;
import com.baeldung.javaxval.methodvalidation.model.Reservation;
import com.baeldung.javaxval.methodvalidation.model.ReservationManagement;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.javaxval.validationgroup;
package com.baeldung.javaxval.validationgroup;
import static org.assertj.core.api.Assertions.assertThat;
@ -8,7 +8,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.baeldung.javaxval.LocaleAwareUnitTest;
import com.baeldung.javaxval.LocaleAwareUnitTest;
import org.junit.BeforeClass;
import org.junit.Test;