Skip to content

convert AssertTrue(false) to fail #464

@timo-abele

Description

@timo-abele

What problem are you trying to solve?

I have in my code some (Junit5) AssertTrue(false, "this shouldn't happen"), because someone didn't use fail when they should have.

Describe the solution you'd like

The Junit5 cleanup recipe should convert such cases to fail("this shouldn't happen").
The AssertJ best pratices recipe might add a similar recipe.

Have you considered any alternatives or workarounds?

Additional context

Are you interested in contributing this feature to OpenRewrite?

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions