Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend JUnitToAssertJRules Refaster rule collection #1484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Stephan202
Copy link
Member

@Stephan202 Stephan202 commented Dec 28, 2024

Suggested commit message:

Extend `JUnitToAssertJRules` Refaster rule collection (#1484)

By migrating all remaining `assertArrayEquals` methods.

Analogous to #1483, this is me putting up a PR for a existing branch, this time after extending the work with the help of GitHub Copilot. (Also here, perhaps an Error Prone check is in order, but not today.)

By migrating all remaining `assertArrayEquals` methods.
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link

Copy link
Contributor

@mohamedsamehsalah mohamedsamehsalah left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
void after(boolean[] actual, String message, boolean[] expected) {
assertThat(actual).withFailMessage(message).containsExactly(expected);
Copy link
Contributor

@mohamedsamehsalah mohamedsamehsalah Dec 29, 2024

Choose a reason for hiding this comment

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

I wanted to suggest the following to make the style consistent with AssertJThrowingCallableRules where we do the message assertion after the checking the expected value.

Suggested change
assertThat(actual).withFailMessage(message).containsExactly(expected);
assertThat(actual).containsExactly(expected).withFailMessage(message);

But Intellij warns Result of 'AbstractAssert. withFailMessage()' is ignored ; which I think is because of @CheckReturnValue annotation.

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

Successfully merging this pull request may close these issues.

2 participants