volodya-lombrozo / jtcop

Maven Plugin for checking tests in Java projects
MIT License
18 stars 2 forks source link

false alarm by RuleAssertionMessage #413

Closed yegor256 closed 2 months ago

yegor256 commented 2 months ago

This is my code:

    @Test
    void runsInDirectory() throws Exception {
        try (Mktemp temp = new Mktemp()) {
            final Path file = temp.path().resolve("test.txt");
            Files.write(file, "Hello, world!".getBytes());
            MatcherAssert.assertThat(
                "file must be written",
                file.toFile().exists(),
                Matchers.is(true)
            );
        }
    }

I'm getting this:

[ERROR]     1) Method runsInDirectory doesn't have assertion statements.
[ERROR]     Please add at least one assertion statement to the test method.
[ERROR]     You can also ignore the rule by adding @SuppressWarnings("JTCOP.RuleAssertionMessage") annotation.
[ERROR]     Rule: RuleAssertionMessage.
[ERROR]     You can read more about the rule here: https://github.com/volodya-lombrozo/jtcop/blob/main/docs/rules/no-assertions.md

It looks like a false positive, because the test method does have an assertion.

yegor256 commented 2 months ago

@volodya-lombrozo please, check this out

volodya-lombrozo commented 2 months ago

@rultor release, tag is 1.3.1, title is 1.3.1.

rultor commented 2 months ago

@rultor release, tag is 1.3.1, title is 1.3.1.

@volodya-lombrozo OK, I will release it now. Please check the progress here

rultor commented 2 months ago

@rultor release, tag is 1.3.1, title is 1.3.1.

@volodya-lombrozo Done! FYI, the full log is here (took me 18min)

volodya-lombrozo commented 2 months ago

@yegor256 Could you try it one more time with 1.3.1 version please?