-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x: Add assertValuesOnly to BaseTestConsumer. #5568
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #5568 +/- ##
===========================================
- Coverage 96.23% 96.2% -0.04%
- Complexity 5819 5824 +5
===========================================
Files 631 631
Lines 41417 41421 +4
Branches 5739 5739
===========================================
- Hits 39859 39849 -10
- Misses 618 623 +5
- Partials 940 949 +9
Continue to review full report at Codecov.
|
@@ -1439,4 +1439,47 @@ public void withTag() { | |||
assertTrue(ex.toString(), ex.toString().contains("testing with item=2")); | |||
} | |||
} | |||
|
|||
@Test | |||
public void assertValuesOnlyWantsOnlyValues() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could just completely rename it to assertValuesOnly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm
} catch (AssertionError ex) { | ||
// expected | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super important, but if you have time let's add test that verifies that method fails if expected value was emitted :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean was not emitted right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant "unexpected", sorry :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
* @param values the values expected | ||
* @return this; | ||
*/ | ||
@SuppressWarnings("unchecked") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Experimental
& @since 2.1.4 - experimental
missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Forgot that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Adds
assertValuesOnly
that asserts that the TestObserver/TestSubscriber received only the specified values in the specified order without terminating.Fixes #5555