diff --git a/pom.xml b/pom.xml
index 3e9bdd0c7..192486870 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.sonatype.oss
oss-parent
- 7
+ 9
uk.co.jemos.podam
@@ -185,6 +185,13 @@
Developer
+
+ Liam KINCAID
+ liam.kincaid@free.fr
+
+ Developer
+
+
@@ -226,10 +233,10 @@
3.10.1
- 7
+ 8
- 7s
-
+ 8
+
-Xlint:all
diff --git a/src/main/java/uk/co/jemos/podam/api/AbstractRandomDataProviderStrategy.java b/src/main/java/uk/co/jemos/podam/api/AbstractRandomDataProviderStrategy.java
index 6637d727d..1333e2979 100644
--- a/src/main/java/uk/co/jemos/podam/api/AbstractRandomDataProviderStrategy.java
+++ b/src/main/java/uk/co/jemos/podam/api/AbstractRandomDataProviderStrategy.java
@@ -10,29 +10,17 @@
import uk.co.jemos.podam.common.*;
import uk.co.jemos.podam.exceptions.PodamMockeryException;
-import uk.co.jemos.podam.typeManufacturers.ArrayTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.BooleanTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.ByteTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.CharTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.CollectionTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.DoubleTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.EnumTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.FloatTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.IntTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.LongTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.MapTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.ShortTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.StringTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.TypeTypeManufacturerImpl;
-import uk.co.jemos.podam.typeManufacturers.TypeManufacturer;
-
-import jakarta.validation.constraints.Email;
+import uk.co.jemos.podam.typeManufacturers.*;
+
+import jakarta.validation.constraints.*;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
+import java.time.*;
+import java.time.temporal.Temporal;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Collection;
@@ -196,8 +184,40 @@ public AbstractRandomDataProviderStrategy(int nbrOfCollectionElements) {
TypeManufacturer> arrayManufacturer = new ArrayTypeManufacturerImpl();
typeManufacturers.put(Cloneable.class, arrayManufacturer);
-
+
+ /**
+ * Support of classes with annotation strategy:
+ * - {@link java.time.Duration}
+ * - {@link java.time.ZoneId}
+ * - {@link java.time.ZoneOffset}
+ */
+ addOrReplaceTypeManufacturer(Duration.class, new DurationTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(MonthDay.class, new MonthDayTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(Period.class, new PeriodTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(ZoneId.class, new ZoneIdTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(ZoneOffset.class, new ZoneOffsetTypeManufacturerImpl());
+
+ /**
+ * Support of {@link java.time.Temporal} classes with annotation strategy:
+ * - {@link jakarta.validation.constraint.Future}
+ * - {@link jakarta.validation.constraint.FutureOfPresent}
+ * - {@link jakarta.validation.constraint.PastOfPresent}
+ * - {@link jakarta.validation.constraint.Past}
+ */
+ addOrReplaceTypeManufacturer(Clock.class, new ClockTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(Instant.class, new InstantTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(LocalDate.class, new LocalDateTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(LocalDateTime.class, new LocalDateTimeTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(LocalTime.class, new LocalTimeTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(OffsetDateTime.class, new OffsetDateTimeTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(OffsetTime.class, new OffsetTimeTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(Year.class, new YearTypeManufacturerImpl());
+ addOrReplaceTypeManufacturer(ZonedDateTime.class, new ZonedDateTimeTypeManufacturerImpl());
addOrReplaceAttributeStrategy(Email.class, new EmailStrategy());
+ addOrReplaceAttributeStrategy(Future.class, new FutureStrategy());
+ addOrReplaceAttributeStrategy(FutureOrPresent.class, new FutureOrPresentStrategy());
+ addOrReplaceAttributeStrategy(PastOrPresent.class, new PastOrPresentStrategy());
+ addOrReplaceAttributeStrategy(Past.class, new PastStrategy());
}
// ------------------->> Public methods
diff --git a/src/main/java/uk/co/jemos/podam/common/BeanValidationStrategy.java b/src/main/java/uk/co/jemos/podam/common/BeanValidationStrategy.java
index 225d2961a..b7bc617d8 100644
--- a/src/main/java/uk/co/jemos/podam/common/BeanValidationStrategy.java
+++ b/src/main/java/uk/co/jemos/podam/common/BeanValidationStrategy.java
@@ -5,6 +5,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
+import uk.co.jemos.podam.api.AttributeMetadata;
import uk.co.jemos.podam.api.PodamUtils;
import uk.co.jemos.podam.exceptions.PodamMockeryException;
@@ -13,12 +15,20 @@
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.math.BigInteger;
+import java.time.Clock;
import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
import java.time.temporal.Temporal;
+import java.time.temporal.TemporalUnit;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
+import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
@@ -31,6 +41,26 @@ public class BeanValidationStrategy implements AttributeStrategy