Skip to content

Commit ad812c4

Browse files
committed
feat: add support for LocalDate to LambdaDslObject #1530
1 parent d914ff1 commit ad812c4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

consumer/src/main/java/au/com/dius/pact/consumer/dsl/LambdaDslObject.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import java.math.BigDecimal;
77
import java.time.Instant;
8+
import java.time.LocalDate;
89
import java.time.ZonedDateTime;
910
import java.util.Arrays;
1011
import java.util.Date;
@@ -325,6 +326,18 @@ public LambdaDslObject date(String name, String format, ZonedDateTime example) {
325326
return this;
326327
}
327328

329+
/**
330+
* Attribute that must match the provided date format
331+
*
332+
* @param name attribute date
333+
* @param format date format to match
334+
* @param example example date to use for generated values
335+
*/
336+
public LambdaDslObject date(String name, String format, LocalDate example) {
337+
object.localDate(name, format, example);
338+
return this;
339+
}
340+
328341
/**
329342
* Attribute named 'time' that must be an ISO formatted time
330343
*/

0 commit comments

Comments
 (0)