Class DurationMatcher

java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeDiagnosingMatcher<Duration>
org.eclipse.microprofile.fault.tolerance.tck.util.DurationMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<Duration>, org.hamcrest.SelfDescribing

public class DurationMatcher extends org.hamcrest.TypeSafeDiagnosingMatcher<Duration>
  • Constructor Details

  • Method Details

    • describeTo

      public void describeTo(org.hamcrest.Description description)
    • matchesSafely

      protected boolean matchesSafely(Duration item, org.hamcrest.Description mismatchDescription)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeDiagnosingMatcher<Duration>
    • closeTo

      public static DurationMatcher closeTo(Duration target, Duration margin)
      Matcher that asserts that a duration is within margin of target
      Parameters:
      target - the target duration
      margin - the margin
      Returns:
      the matcher
    • closeTo

      public static DurationMatcher closeTo(Duration target)
      Matcher that asserts that a duration is within 100ms of target
      Parameters:
      target - the target duration
      Returns:
      the matcher