Class UserNotificationWithFeedbackTestHelper

java.lang.Object
it.tidalwave.util.ui.UserNotificationWithFeedbackTestHelper

public final class UserNotificationWithFeedbackTestHelper extends Object
A factory class to create testing matchers.
Author:
Fabrizio Giudici
  • Constructor Details

    • UserNotificationWithFeedbackTestHelper

      public UserNotificationWithFeedbackTestHelper()
  • Method Details

    • notification

      @Nonnull public static UserNotificationMatcher notification(@Nonnull String captionRegex, @Nonnull String textRegex)
      Creates a UserNotification matcher for the given caption and text.
      Parameters:
      captionRegex - the regular expression that should match the caption
      textRegex - the regular expression that should match the text
      Returns:
      the matcher
    • notificationWithFeedback

      @Nonnull public static UserNotificationWithFeedbackMatcher notificationWithFeedback(@Nonnull String captionRegex, @Nonnull String textRegex)
      Creates a UserNotificationWithFeedback matcher for the given caption and text.
      Parameters:
      captionRegex - the regular expression that should match the caption
      textRegex - the regular expression that should match the text
      Returns:
      the matcher
    • confirm

      public static org.mockito.stubbing.Answer<Void> confirm()
      An Answer that triggers a confirmation to a UserNotificationWithFeedback.
      Returns:
      the Answer
    • doAndConfirm

      public static org.mockito.stubbing.Answer<Void> doAndConfirm(@Nonnull Consumer<? super org.mockito.invocation.InvocationOnMock> thingToDo)
      An Answer that does a thing and then triggers a confirmation to a UserNotificationWithFeedback.
      Parameters:
      thingToDo - the thing to do
      Returns:
      the Answer
      Since:
      3.2-ALPHA-24
    • cancel

      public static org.mockito.stubbing.Answer<Void> cancel()
      An Answer that triggers a cancellation to a UserNotificationWithFeedback.
      Returns:
      the Answer