Package dev.aherscu.qa.testing.utils
Class TimeMatchers
- java.lang.Object
-
- dev.aherscu.qa.testing.utils.TimeMatchers
-
public class TimeMatchers extends Object
-
-
Constructor Summary
Constructors Constructor Description TimeMatchers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Comparable<T> & Temporal>
org.hamcrest.Matcher<T>after(T time)
Matches a time strictly after that givenstatic <T extends Comparable<T> & Temporal>
org.hamcrest.Matcher<T>before(T time)
Matches a time strictly before that givenstatic <T extends Comparable<T>>
org.hamcrest.Matcher<T>between(T earlierOrEqual, T laterOrEqual)
Matches a Comparable value greater than or equal to the first given value and less than or equal to the second given valuestatic <T extends Comparable<T> & TemporalAmount>
org.hamcrest.Matcher<T>longerThan(T amount)
Matches an amount of time strictly longer than that specifiedstatic org.hamcrest.Matcher<Period>
matches(org.hamcrest.Matcher<Integer> yearsMatcher, org.hamcrest.Matcher<Integer> monthsMatcher, org.hamcrest.Matcher<Integer> daysMatcher)
Matches any Period for which the years, months and days match the provided matchersstatic <T extends Comparable<T> & TemporalAmount>
org.hamcrest.Matcher<T>shorterThan(T amount)
Matches an amount of time strictly shorter than that specified
-
-
-
Method Detail
-
after
public static <T extends Comparable<T> & Temporal> org.hamcrest.Matcher<T> after(T time)
Matches a time strictly after that given- Type Parameters:
T
- The type of time, e.g. Instant or LocalDateTime- Parameters:
time
- Time for comparison
-
before
public static <T extends Comparable<T> & Temporal> org.hamcrest.Matcher<T> before(T time)
Matches a time strictly before that given- Type Parameters:
T
- The type of time, e.g. Instant or LocalDateTime- Parameters:
time
- Time for comparison
-
between
public static <T extends Comparable<T>> org.hamcrest.Matcher<T> between(T earlierOrEqual, T laterOrEqual)
Matches a Comparable value greater than or equal to the first given value and less than or equal to the second given value- Type Parameters:
T
- The type to compare, e.g. Temporal or TemporalAmount
-
longerThan
public static <T extends Comparable<T> & TemporalAmount> org.hamcrest.Matcher<T> longerThan(T amount)
Matches an amount of time strictly longer than that specified- Type Parameters:
T
- The type to compare, typically Duration- Parameters:
amount
- amount of time for comparison
-
shorterThan
public static <T extends Comparable<T> & TemporalAmount> org.hamcrest.Matcher<T> shorterThan(T amount)
Matches an amount of time strictly shorter than that specified- Type Parameters:
T
- The type to compare, typically Duration- Parameters:
amount
- amount of time for comparison
-
-