Skip to content

Conversation

@ottlinger
Copy link
Contributor

Starting to migrate to AssertJ assertions .....

for (String fmt : formats) {
boolean found = processText(license, String.format(fmt, target[TEXT]));
license.reset();
assertTrue(found, () -> String.format("%s %s did not match pattern '%s' for target string %s", id,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Claudenw it seems that assertJ has no equivalent to this supplier construct.
Do you have an idea how to transform these kind of tests into assertJ or should we leave the other assertTrue() - WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

You could generate the message string and just use it. It will have some performance impact. Or you could just leave the junit 5 format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I never worked with that construct before and wondered what it is good for. Thx.

@ottlinger ottlinger self-assigned this Jun 28, 2024
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.

2 participants