Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qulice fails at org.hamcrest.MatcherAssert.assertThat(String reason, boolean assertion) #1315

Open
ArtemGet opened this issue Jan 27, 2025 · 2 comments

Comments

@ArtemGet
Copy link

TL:DR the same issue occurred in jtcop.
Hi, I faced an issue using qulice version 0.23.0 together with org.hamcrest.MatcherAssert.assertThat(String reason, boolean assertion). Qulice fails at test:

@Test  
void routesNotWhenNotMatchAndNoSpareCmd() {  
    MatcherAssert.assertThat(  
        "Routes to command that not matched",  
        new RouteFork<>(  
            new FkMatch(false),  
            new FkCmd(new FkSend())  
        ).route(new FkWrap()).isEmpty()  
    );  
}

With an error:

[INFO] PMD: src/test/java/com/github/artemget/teleroute/route/RouteForkTest.java[56-56]: JUnit assertions should include a message (JUnitAssertionsShouldIncludeMessage)

It forces to write boilerplate Matchers.equalTo(true) or ignoring check every time a test needs to assert that method return true/false because qulice dont see an assertion message (but it is obvious that it exists). For example, this test is valid:

@Test  
void routesNotWhenNotMatchAndNoSpareCmd() {  
    MatcherAssert.assertThat(  
        "Routes to command that not matched",  
        new RouteFork<>(  
            new FkMatch(false),  
            new FkCmd(new FkSend())  
        ).route(new FkWrap()).isEmpty(),  
        Matchers.equalTo(true)  
    );  
}

Here is GHA log if needed.

@ArtemGet
Copy link
Author

@yegor256 Could you take a look, please?

Copy link

@ArtemGet thanks for the report, here is a feedback:

Problems

  • Ambiguous Title: The bug report's title does not specify the conditions under which the failure occurs or the affected code aspect.
  • Lack of Environment Details: The bug report does not contain information regarding the environment where the bug occurred, such as the operating system, browser or device type, and software version.
  • Missing Steps to Reproduce: Despite including the error code, the bug report does not offer clear steps to reproduce the issue, which is essential for developers to duplicate the problem and identify its origin.

I would recommend providing clear, step-by-step instructions on how to reproduce the issue.

Please fix the bug report in order it to get resolved faster.
Analyzed with gpt-4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant