Skip to content

UnitTestShouldIncludeAssert doesn't find assertion in a lambda #1524

@volodya-lombrozo

Description

@volodya-lombrozo

I have the following java test:

@Test
void checksThatWeCanCompileTheProgramWithProxySet(@Mktmp final Path tmp) throws Exception {
    new Farea(tmp).together(
        f -> {
            f.clean();
            final Requisite settings = f.files().file("settings.xml").write(
                ProxyIT.settings(this.port).getBytes(StandardCharsets.UTF_8)
            );
            f.files()
                .file("src/main/eo/foo/x/y/main.eo")
                .write(ProxyIT.program().getBytes(StandardCharsets.UTF_8));
            new AppendedPlugin(f).value()
                .goals("register", "assemble", "resolve", "place");
            f.withOpt("-s");
            f.withOpt(settings.path().toString());
            f.exec("package");
            MatcherAssert.assertThat(
                "We expect the build is successful when a proxy is set",
                f.log().content(),
                Matchers.containsString("BUILD SUCCESS")
            );
        }
    );
}

qulice complaints with the following error:

[INFO] PMD: src/test/java/org/eolang/maven/ProxyIT.java[93-93]: This unit test should include assert() or fail() (UnitTestShouldIncludeAssert)

Expected behaviour:
qulice should find MatcherAssert.assertThat assertion inside of the lambda expression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions