Skip to content

Replace AssertJ internal APIs with alternative implementations #46855

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

Closed
wants to merge 1 commit into from

Conversation

scordio
Copy link
Contributor

@scordio scordio commented Aug 17, 2025

This change replaces the AssertJ internal API usages with alternative implementations.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 17, 2025
@scordio scordio force-pushed the assertj-internal-api branch from b33b5ae to a909abe Compare August 17, 2025 07:39
}

public ItemMetadataAssert isProperty() {
objects.assertEqual(this.info, this.actual.isOfItemType(ItemType.PROPERTY), true);
extracting((actual) -> actual.isOfItemType(ItemType.PROPERTY)).isEqualTo(true);
Copy link
Contributor Author

@scordio scordio Aug 17, 2025

Choose a reason for hiding this comment

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

I favored the usage of a custom extracting method to leverage the internal propagation of the assertion state.

In case that isn't a crucial feature for the current scope, such lines could also be written as:

Suggested change
extracting((actual) -> actual.isOfItemType(ItemType.PROPERTY)).isEqualTo(true);
Assertions.assertThat(this.actual.isOfItemType(ItemType.PROPERTY)).isTrue();

and the custom extracting method could be deleted.

@snicoll snicoll self-assigned this Aug 18, 2025
@snicoll snicoll added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 18, 2025
@snicoll snicoll added this to the 3.4.9 milestone Aug 18, 2025
snicoll pushed a commit that referenced this pull request Aug 18, 2025
@snicoll snicoll closed this in 39dced5 Aug 18, 2025
@snicoll
Copy link
Member

snicoll commented Aug 18, 2025

Thanks very much again, @scordio.

@scordio scordio deleted the assertj-internal-api branch August 18, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants