Skip to content

Add FindIncompleteAssertions - #1193

Closed
Jammy-Louie wants to merge 2 commits into
mainfrom
add-rspec-s2970-incomplete-assertions
Closed

Jammy-Louie wants to merge 2 commits into
mainfrom
add-rspec-s2970-incomplete-assertions

Conversation

@Jammy-Louie

Copy link
Copy Markdown
Contributor

Problem

An assertion that is started but never finished checks nothing, and the test still passes: assertThat(result);, assertThat(result).as("description"); or Mockito.verify(mockedList);. TestsShouldIncludeAssertions counts these as assertions, so these tests look covered.

How

FindIncompleteAssertions marks assertThat(..) (AssertJ, Fest, Truth) and Mockito verify(..) calls whose result isn't used. A chain of only AssertJ configuration calls, like assertThat(x).as("description");, is marked too.

Not covered: AssertJ then(x), soft assertions and BDDMockito then(mock).should().

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Oct 15, 2026
@Jammy-Louie
Jammy-Louie marked this pull request as ready for review October 16, 2026 17:22
@timtebeek

Copy link
Copy Markdown
Member

@Jammy-Louie

Copy link
Copy Markdown
Contributor Author

closing as unnecessary

@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 16, 2026
@timtebeek
timtebeek deleted the add-rspec-s2970-incomplete-assertions branch October 16, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants