InstantSource
Annotation to be utilized on a parameter of type Instant in a parameterized test. The annotated parameter;s value will be populated with a randomized value derived from the provided values array.
The values array should consist of instant string values, formatted according to the java.time.format.DateTimeFormatter.ISO_INSTANT standard.
Samples
fun testInstantSource(
@InstantSource(
values = [
"2023-01-01T00:00:00.000Z",
"2022-01-01T00:00:00.000Z",
"2021-01-01T00:00:00.000Z"
]
)
value: Instant
) {
assertThat(value).isLessThan(Instant.now())
}Content copied to clipboard