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

arch unit fails with the following errors on 0.23.1 while does not report the same error with 0.15.0 #4

Open
nagkumar opened this issue Jul 25, 2022 · 3 comments

Comments

@nagkumar
Copy link

endra%20Kumar/.m2/repository/org/junit/platform/junit-platform-commons/1.8.2/junit-platform-commons-1.8.2.jar!/, jar:file:/C:/Users/Raja%20Nagendra%20Kumar/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/]
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.029 s - in ServiceRulesTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   GeneralCodingRulesTest Rule 'methods that are annotated with @Bean should be public, because @Bean annotation does not work in non public methods' failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can either use `ArchRule.allowEmptyShould(true)` on a single rule or set the configuration property `archRule.failOnEmptyShould = false` to change the behavior globally.
[ERROR]   GeneralCodingRulesTest Rule 'fields that are static and are final and do not have name 'serialVersionUID' and do not have modifier SYNTHETIC should have name matching '.*^[A-Z].*', because Variables with static and final modifiers should be named in uppercase' failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can either use `ArchRule.allowEmptyShould(true)` on a single rule or set the configuration property `archRule.failOnEmptyShould = false` to change the behavior globally.
[ERROR]   GeneralCodingRulesTest Rule 'fields that have raw type ch.qos.logback.classic.Logger should be private and should be static and should be final and should have name 'LOGGER', because Logger variables should be private, static and final, and it should be named as LOGGER' failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can either use `ArchRule.allowEmptyShould(true)` on a single rule or set the configuration property `archRule.failOnEmptyShould = false` to change the behavior globally.
[INFO]
[ERROR] Tests run: 33, Failures: 3, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  20.274 s
[INFO] Finished at: 2022-07-25T08:37:26+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project api-example-archunit: There are test failures.
[ERROR]
@nagkumar
Copy link
Author

nagkumar commented Jul 25, 2022

on 0.22.0 no failures were reported.. looks like this issue has come only in 0.23.1

@nagkumar
Copy link
Author

in 0.23.0 the error is

-commons-1.7.0.jar!/]
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.033 s - in ServiceRulesTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   GeneralCodingRulesTest Rule failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can set the ArchUnit property archRule.failOnEmptyShould = false
[ERROR]   GeneralCodingRulesTest Rule failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can set the ArchUnit property archRule.failOnEmptyShould = false
[ERROR]   GeneralCodingRulesTest Rule failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can set the ArchUnit property archRule.failOnEmptyShould = false
[INFO]
[ERROR] Tests run: 33, Failures: 3, Errors: 0, Skipped: 0
[INFO]

@nagkumar
Copy link
Author

fix is add archunit.properties with the property

archRule.failOnEmptyShould = false

image

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