Package it.tidalwave.util.ui
Class UserNotificationWithFeedbackTestHelper
java.lang.Object
it.tidalwave.util.ui.UserNotificationWithFeedbackTestHelper
A factory class to create testing matchers.
- Author:
- Fabrizio Giudici
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.mockito.stubbing.Answer
<Void> cancel()
AnAnswer
that triggers a cancellation to aUserNotificationWithFeedback
.static org.mockito.stubbing.Answer
<Void> confirm()
AnAnswer
that triggers a confirmation to aUserNotificationWithFeedback
.static org.mockito.stubbing.Answer
<Void> doAndConfirm
(Consumer<? super org.mockito.invocation.InvocationOnMock> thingToDo) AnAnswer
that does a thing and then triggers a confirmation to aUserNotificationWithFeedback
.static UserNotificationMatcher
notification
(String captionRegex, String textRegex) Creates aUserNotification
matcher for the given caption and text.notificationWithFeedback
(String captionRegex, String textRegex) Creates aUserNotificationWithFeedback
matcher for the given caption and text.
-
Constructor Details
-
UserNotificationWithFeedbackTestHelper
public UserNotificationWithFeedbackTestHelper()
-
-
Method Details
-
notification
@Nonnull public static UserNotificationMatcher notification(@Nonnull String captionRegex, @Nonnull String textRegex) Creates aUserNotification
matcher for the given caption and text.- Parameters:
captionRegex
- the regular expression that should match the captiontextRegex
- the regular expression that should match the text- Returns:
- the matcher
-
notificationWithFeedback
@Nonnull public static UserNotificationWithFeedbackMatcher notificationWithFeedback(@Nonnull String captionRegex, @Nonnull String textRegex) Creates aUserNotificationWithFeedback
matcher for the given caption and text.- Parameters:
captionRegex
- the regular expression that should match the captiontextRegex
- the regular expression that should match the text- Returns:
- the matcher
-
confirm
AnAnswer
that triggers a confirmation to aUserNotificationWithFeedback
.- Returns:
- the
Answer
-
doAndConfirm
public static org.mockito.stubbing.Answer<Void> doAndConfirm(@Nonnull Consumer<? super org.mockito.invocation.InvocationOnMock> thingToDo) AnAnswer
that does a thing and then triggers a confirmation to aUserNotificationWithFeedback
.- Parameters:
thingToDo
- the thing to do- Returns:
- the
Answer
- Since:
- 3.2-ALPHA-24
-
cancel
AnAnswer
that triggers a cancellation to aUserNotificationWithFeedback
.- Returns:
- the
Answer
-