You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MapAssert.extractingByKeys (and related) should verify the key exists to avoid an NPE
Example
This works
Assertions.assertThat(altIds).hasSize(1).containsKey(alternateId).extractingByKeys(alternateId) //check more stuff
This can result in an NPE if the key is missing, but I believe should be implicitly equivalent to the above giving a better error if extraction can not occur. If notEmpty() is not called, it probably also should be.
Assertions.assertThat(altIds).hasSize(1).extractingByKeys(alternateId) // check more stuff
if the NPE is a bug this is version 3.23.0
The text was updated successfully, but these errors were encountered:
xenoterracide
changed the title
MapAssert
MapAssert check contains key when extracting keys implicitly
Dec 8, 2023
Feature summary
MapAssert.extractingByKeys
(and related) should verify the key exists to avoid an NPEExample
This works
This can result in an NPE if the key is missing, but I believe should be implicitly equivalent to the above giving a better error if extraction can not occur. If
notEmpty()
is not called, it probably also should be.if the NPE is a bug this is version 3.23.0
The text was updated successfully, but these errors were encountered: