volodya-lombrozo / jtcop

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

Support for cactoos matchers API #325

Open l3r8yJ opened 7 months ago

l3r8yJ commented 7 months ago

@volodya-lombrozo take a look, please. jtcop check fails with

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

on test

@Test
void throwsOnCollectionChange() {
    final Set<String> checks = new ScannedChecks().value();
    new Assertion<>(
        new FormattedText(
        "Should throw exception when trying to modify: \n\t%s",
            checks
        ).toString(),
        () -> checks.add("123"),
        new Throws<>(UnsupportedOperationException.class)
    ).affirm();
}

but it should be okay

I think it would be nice if jtcop supported cactoos-matchers, wdyt?

volodya-lombrozo commented 7 months ago

@l3r8yJ Yes, I agree. Thank you for reporting this bug!