Skip to content

Conversation

@kristofarkas
Copy link
Contributor

Before this PR

If the test wants to assert that a service exception has no arguments the code looks like this:

assertThatServiceExceptionThrownBy(() -> throw new ServiceException()).hasArgs();

Reading the code, it is easy to think that the test is actually checking if there are arguments, not that the argument list is empty.

After this PR

assertThatServiceExceptionThrownBy(() -> throw new ServiceException()).hasNoArgs();

==COMMIT_MSG==
Service exception assert for no args.
==COMMIT_MSG==

Possible downsides?

Having both methods might be equally confusing.

@changelog-app
Copy link

changelog-app bot commented Oct 14, 2021

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Service exception assert for no args.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from carterkozak October 14, 2021 16:59
@bulldozer-bot bulldozer-bot bot merged commit 29618f5 into develop Oct 15, 2021
@bulldozer-bot bulldozer-bot bot deleted the kristofarkas/assert-has-no-args branch October 15, 2021 13:59
@svc-autorelease
Copy link
Collaborator

Released 2.21.0

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants