Skip to content

Conversation

timtebeek
Copy link
Contributor

  • There were some drop in replacements not yet applied, like isCloseTo.
  • A bit of weird formatting in NumberAssertionsExamples where the next assertThat was on the end of the previous line.
  • A missing hasToString instead of ....toString()).isEqualTo(...

@timtebeek
Copy link
Contributor Author

I had intentionally left out a few optimization that are redundant, such as the check here on isPresent() in a method chain where the subsequent assertion imply the entry is present:

@Test
public void optional_assertions_examples() {
Optional<String> optional = Optional.of("Test");
assertThat(optional).isPresent()
.containsInstanceOf(String.class)
.contains("Test");

While that could be an improvement in actual use, this repository aims to show the breadth of assertions available, which then makes sense to leave that isPresent() and others in, perhaps. If you feel we can drop those for clarity then let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant