Fix documentation/name for `AbstractMapAssert#containsOnlyKeys`

Open
#23 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
documentation

Research direction

Start at the AbstractMapAssert#containsOnlyKeys entry point and read its Javadoc, including the existing example describing empty-map behavior. Review the related issue #200 and the linked semantics discussion, then update the documentation and determine whether the method name should change so the empty-map behavior is explicit.

Written by the indexing model from the issue text.

Description

According to the method name and it's documentation I expect assertThat(emptyMap()).containsOnlyKeys("x") to NOT fail.

There's one example in the Javadoc that helps me understand the real semantics. However, I'd like to see that also in the text above, and ideally in the method name.

Related: https://math.stackexchange.com/questions/202452/why-is-predicate-all-as-in-allset-true-if-the-set-is-empty

See https://github.com/joel-costigliola/assertj-core/issues/200

Dominant language
CSS
Stars
26
Forks
32
Avg merge
1d 19h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from assertj/doc

All issues in assertj/doc

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.