Class DeadlineManagerValidator

java.lang.Object
org.axonframework.test.deadline.DeadlineManagerValidator

public class DeadlineManagerValidator extends Object
Helps validation of deadline mechanism provided by StubDeadlineManager.
Since:
3.3
Author:
Milan Savic
  • Constructor Details

    • DeadlineManagerValidator

      public DeadlineManagerValidator(StubDeadlineManager deadlineManager, FieldFilter fieldFilter)
      Instantiates this validator with deadlineManager which is used for validation purposes and fieldFilter.
      Parameters:
      deadlineManager - Stub implementation of deadline manager which keeps track of scheduled and met deadlines
      fieldFilter - Indicates whether any given Field should be accepted for processing or not
  • Method Details

    • currentDateTime

      public Instant currentDateTime()
      The current date time as stated by the configured StubDeadlineManager.
      Returns:
      current date time as stated by the configured StubDeadlineManager
    • assertScheduledDeadlineMatching

      public void assertScheduledDeadlineMatching(Duration duration, org.hamcrest.Matcher<?> matcher)
      Asserts that a deadline scheduled after given duration matches the given matcher.
      Parameters:
      duration - the delay expected before the deadline is met
      matcher - the matcher that must match with the deadline scheduled at the given time
    • assertScheduledDeadlineMatching

      public void assertScheduledDeadlineMatching(Instant scheduledTime, org.hamcrest.Matcher<?> matcher)
      Asserts that a deadline scheduled at the given scheduledTime matches the given matcher.
      Parameters:
      scheduledTime - the time at which the deadline should be met
      matcher - the matcher that must match with the deadline scheduled at the given time
    • assertNoScheduledDeadlineMatching

      public void assertNoScheduledDeadlineMatching(org.hamcrest.Matcher<?> matcher)
      Asserts that no deadline matching the given matcher has been scheduled.
      Parameters:
      matcher - the matcher defining the deadline which should not be scheduled
    • assertDeadlinesMetMatching

      @Deprecated public void assertDeadlinesMetMatching(org.hamcrest.Matcher<? extends Iterable<?>> matcher)
      Asserts that deadlines have been met (which have passed in time) match the given matcher.
      Parameters:
      matcher - The matcher that will validate the actual deadlines
    • assertTriggeredDeadlinesMatching

      public void assertTriggeredDeadlinesMatching(org.hamcrest.Matcher<? extends Iterable<?>> matcher)
      Asserts that the triggered deadlines match the given matcher.
      Parameters:
      matcher - the matcher that will validate the actual deadlines
    • assertDeadlinesMet

      @Deprecated public void assertDeadlinesMet(Object... expected)
      Deprecated.
      Asserts that the given expected deadlines have been met (which have passed in time).
      Parameters:
      expected - The deadlines that must have been met
    • assertTriggeredDeadlines

      public void assertTriggeredDeadlines(Object... expected)
      Asserts that the given expected deadlines have been triggered.
      Parameters:
      expected - the deadlines that must have been triggered
    • assertTriggeredDeadlinesWithName

      public void assertTriggeredDeadlinesWithName(String... expectedDeadlineNames)
      Asserts that the given expectedDeadlineNames have been triggered. Matches the complete and exact sequence of the given names with the result of StubDeadlineManager.getTriggeredDeadlines().
      Parameters:
      expectedDeadlineNames - the deadline names that must have been triggered
    • assertTriggeredDeadlinesOfType

      public void assertTriggeredDeadlinesOfType(Class<?>... expectedDeadlineTypes)
      Asserts that the given expectedDeadlineTypes have been triggered. Matches the complete and exact sequence of the given types with the result of StubDeadlineManager.getTriggeredDeadlines().
      Parameters:
      expectedDeadlineTypes - the deadline types that must have been triggered
    • assertNoScheduledDeadlines

      public void assertNoScheduledDeadlines()
      Asserts that no deadlines are scheduled.