Skip to content

Add values() navigation method to AbstractMapAssert #3291

@xenoterracide

Description

@xenoterracide

Feature summary

Improve matching only MapAssert Value Properties.

Example

I feel like this could be one statement

assertThat(cpCard.getAltIds())
  .as("AlternateId saved on card")
  .hasSize(1); // avoids getAltIds() possible NPE... 

assertThat(cpCard.getAltIds().values())
  .as("AlternateId saved on Card")
  .first()
  .returns(LoyaltyCardsValueAltIdsValue.StatusEnum.ACTIVE, LoyaltyCardsValueAltIdsValue::getStatus);

It feels like I should be able to do something like. I tried a number of extracting but it all ended up more convoluted than 2 statements, or required a weaker static typing

assertThat(cpCard.getAltIds())
  .hasSize(1)
  .values()
  .first()
  .returns(...);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions