You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following rule produces an assertion error (in IntelliJ) that contains only text, no hyperlinks to the classes.
/**
* Test classes should not be public (Junit 5).
*/
@Test
void shouldNotUsePublicInTestCases() {
JavaClasses classes = new ClassFileImporter().importPackages("edu.hm.hafner");
ArchRule noPublicClasses = noClasses().that().haveSimpleNameEndingWith("Test")
.should().bePublic();
noPublicClasses.check(classes);
}
Produces the output (example):
java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'no classes that have simple name ending with 'Test' should be public' was violated (71 times):
class edu.hm.hafner.ArchitectureRulesTest has modifier PUBLIC
class edu.hm.hafner.analysis.AbstractParserTest has modifier PUBLIC
class edu.hm.hafner.analysis.IssueFilterTest has modifier PUBLIC
class edu.hm.hafner.analysis.IssueTest has modifier PUBLIC
class edu.hm.hafner.analysis.parser.AcuCobolParserTest has modifier PUBLIC
class edu.hm.hafner.analysis.parser.AjcParserTest has modifier PUBLIC
class edu.hm.hafner.analysis.parser.AnsibleLintTest has modifier PUBLIC
[...]
Expected result:
each class has a hyperlink (as the other assertion errors from ArchUnit).
The text was updated successfully, but these errors were encountered:
Yeah, I remember that I didn't include this back then, cause I wasn't sure, which line number to print. However, I guess (SomeClass.java:0) would be an alright link to just jump to the file... I'll add this with the next release (I think there are more places than this, where it would make sense to add the link, like assignable/implement, where I didn't include it either)
The following rule produces an assertion error (in IntelliJ) that contains only text, no hyperlinks to the classes.
Produces the output (example):
Expected result:
each class has a hyperlink (as the other assertion errors from ArchUnit).
The text was updated successfully, but these errors were encountered: