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

RuleAssertionMessage ignores the assertion inside the loop #353

Closed
c71n93 opened this issue Apr 16, 2024 · 5 comments · Fixed by #354
Closed

RuleAssertionMessage ignores the assertion inside the loop #353

c71n93 opened this issue Apr 16, 2024 · 5 comments · Fixed by #354
Assignees
Labels
bug Something isn't working

Comments

@c71n93
Copy link

c71n93 commented Apr 16, 2024

@volodya-lombrozo I faced with some problem.
Consider this example:

    @Test
    void choosesTransformerFactoryInConcurrentEnvironment() {
        for (final Class<? extends TransformerFactory> clazz : IntStream.range(0, 100).parallel()
            .mapToObj(i -> TransformerFactory.newInstance().getClass())
            .collect(Collectors.toList())) {
            MatcherAssert.assertThat(
                "TO ADD ASSERTION MESSAGE",
                clazz,
                Matchers.typeCompatibleWith(TransformerFactoryImpl.class)
            );
        }
    }

For this test I have such jtcop output:

[ERROR]         2) Method choosesTransformerFactoryInConcurrentEnvironment 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.

It looks like check ignores asserts inside the loops.

@volodya-lombrozo volodya-lombrozo self-assigned this Apr 16, 2024
@volodya-lombrozo volodya-lombrozo added the bug Something isn't working label Apr 16, 2024
@volodya-lombrozo
Copy link
Owner

volodya-lombrozo commented Apr 16, 2024

@c71n93 Thank you for the reporting this bug! We will try to solve it.

@volodya-lombrozo
Copy link
Owner

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

@rultor
Copy link
Collaborator

rultor commented Apr 17, 2024

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

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

@rultor
Copy link
Collaborator

rultor commented Apr 17, 2024

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

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

@volodya-lombrozo
Copy link
Owner

@c71n93 The bug should be fixed in the 1.2.2 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants