Skip to content

Conversation

@gsheasby
Copy link
Contributor

Before this PR

Using hasArgs required you to specify all args, which was not trivial if some args were non-deterministic.

After this PR

==COMMIT_MSG==
Added ServiceExceptionAssert.hasArgsIncluding, a weaker form of hasArgs.
==COMMIT_MSG==

Possible downsides?

N/A? Additive change.

@changelog-app
Copy link

changelog-app bot commented Nov 27, 2020

Generate changelog in changelog/@unreleased

Type

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

Description

Added ServiceExceptionAssert.hasArgsIncluding, a weaker form of hasArgs.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from CRogers November 27, 2020 15:48
@pkoenig10
Copy link
Member

Please call this containsArgs to match AssertJ naming conventions and palantir/safe-logging#176.

assertThatThrownBy(() -> Assertions.assertThat(
new ServiceException(actualType, SafeArg.of("a", "b"), UnsafeArg.of("c", "d")))
.containsArgs(UnsafeArg.of("a", "b")))
.isInstanceOf(AssertionError.class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: assert the message here

@bulldozer-bot bulldozer-bot bot merged commit 97ad777 into develop Dec 8, 2020
@bulldozer-bot bulldozer-bot bot deleted the feature/hasArgsIncluding branch December 8, 2020 13:34
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.

3 participants