Added 3rd-Party scope related tests#39
Conversation
ThirdPartyRulesTest.java: - combined all third-party rules inside ThirdPartyRulesTest.java - deleted distinct rule test files - changed all ArchRules to public as a part of the preparation for task devonfw-sample#19 - rules 1, 3, and 4 utilize now the present PackageStructure type. --- rules 1 and 4 also test scope-related conditions for classic architecture projects now.
hohwille
left a comment
There was a problem hiding this comment.
@vlad961 Thanks for your rework. This is now great and functionally complete. 👍
I love the beauty of first simple rules that utilize the simplicity of ArchUnit usage.
Sorry for being picky, but could you please extract the org.springframework.transaction.annotation.Transactional in the same way?
Also I am wondering if we could create predicates instead of conditions and simply use ArchUnit more explicitly via something like this:
noClasses().that(haveLayerOtherThanDataaccess).should().dependOnClassesThat().resideInAPackage("javax.persistence..").because("...");
This one is not exactly correct but just to give the idea. Also aspects like haveLayerXXX or haveLayerOtherThanXXX could be reused better.
Please note that the latter is just a thought that I want to share. You do not have to implement it in this PR already. Also my FYI comments have "nice to have" character.
So let us better first get this PR done and merged and then we can create further improvements.
Your code is IMHO already fully correct from its behavior...
src/test/java/com/devonfw/sample/archunit/ThirdPartyRulesTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/devonfw/sample/archunit/ThirdPartyRulesTest.java
Outdated
Show resolved
Hide resolved
-Implemented the most recent annotation of @hohwille. -Minor refactoring.
#5
Optional Scope
ThirdPartyRulesTest.java: