Skip to content

[java] JUnitTestsShouldIncludeAssert: Support AssertJ soft assertions #1435

@adangel

Description

@adangel

Rule: JUnitTestsShouldIncludeAssert

Description:

Using Soft Assertions shouldn't trigger the rule, since these are assertions, too.

Code Sample demonstrating the issue:

import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;
class FooTest {
    @Test
    void testFoo() {
        var softly = new SoftAssertions();
        softly.assertThat("doesn't matter").isEqualTo("doesn't matter");
        softly.assertAll();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rules

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions