weekdayStrategy

fun FeatureBuilder.weekdayStrategy(timezone: TimeZone = TimeZone.UTC, block: WeekdayBuilder.() -> Unit)(source)

Configures a WeekdayStrategy for this feature using a DSL builder.

The feature will be enabled only on the specified days of the week. Days are evaluated in the specified timezone.

Example

feature("weekday-only") {
weekdayStrategy(TimeZone.of("Europe/London")) {
+DayOfWeek.MONDAY
+DayOfWeek.TUESDAY
+DayOfWeek.WEDNESDAY
+DayOfWeek.THURSDAY
+DayOfWeek.FRIDAY
}
}

Author

Yonatan Karp-Rudin

Parameters

timezone

The timezone to use for day calculations. Defaults to UTC.

block

A DSL block to configure the allowed days of the week.

See also

for hour-based enabling