@@ -4,7 +4,7 @@ The following section illustrates some typical checks you could do with ArchUnit
44
55=== Package Dependency Checks
66
7- [plantuml, "package-deps-no-access"]
7+ [plantuml, "package-deps-no-access", svg, opts=interactive ]
88----
99skinparam componentStyle uml2
1010skinparam component {
@@ -23,7 +23,7 @@ noClasses().that().resideInAPackage("..source..")
2323 .should().dependOnClassesThat().resideInAPackage("..foo..")
2424----
2525
26- [plantuml, "package-deps-only-access"]
26+ [plantuml, "package-deps-only-access", svg, opts=interactive ]
2727----
2828skinparam componentStyle uml2
2929skinparam component {
@@ -47,8 +47,10 @@ classes().that().resideInAPackage("..foo..")
4747
4848=== Class Dependency Checks
4949
50- [plantuml, "class-naming-deps"]
50+ [plantuml, "class-naming-deps", svg, opts=interactive ]
5151----
52+ @startuml
53+ hide empty members
5254skinparam componentStyle uml2
5355
5456skinparam component {
@@ -69,6 +71,7 @@ note top on link #crimson: forbidden
6971
7072Bar --> FooBar #green
7173note left on link #green: allowed
74+ @enduml
7275----
7376
7477[source,java]
@@ -79,8 +82,11 @@ classes().that().haveNameMatching(".*Bar")
7982
8083=== Class and Package Containment Checks
8184
82- [plantuml, "class-package-contain"]
85+ [plantuml, "class-package-contain", svg, opts=interactive ]
8386----
87+ @startuml
88+ hide empty members
89+ set separator none
8490skinparam componentStyle uml2
8591
8692skinparam component {
@@ -103,6 +109,7 @@ package com.wrong {
103109
104110note "resides in wrong package" as WrongPackage #crimson
105111FooController .. WrongPackage
112+ @enduml
106113----
107114
108115[source,java]
@@ -113,8 +120,10 @@ classes().that().haveSimpleNameStartingWith("Foo")
113120
114121=== Inheritance Checks
115122
116- [plantuml, "inheritance-naming-check"]
123+ [plantuml, "inheritance-naming-check", svg, opts=interactive ]
117124----
125+ @startuml
126+ hide empty members
118127skinparam componentStyle uml2
119128
120129skinparam component {
@@ -137,6 +146,7 @@ FtpConnection --|> Connection #green
137146SshThing --|> Connection #crimson
138147
139148note right on link #crimson: Has wrong name
149+ @enduml
140150----
141151
142152[source,java]
@@ -145,8 +155,11 @@ classes().that().implement(Connection.class)
145155 .should().haveSimpleNameEndingWith("Connection")
146156----
147157
148- [plantuml, "inheritance-access-check"]
158+ [plantuml, "inheritance-access-check", svg, opts=interactive ]
149159----
160+ @startuml
161+ hide empty members
162+ set separator none
150163skinparam componentStyle uml2
151164
152165skinparam component {
@@ -173,6 +186,7 @@ ValidPersistenceUser --> EntityManager #green
173186IllegalPersistenceUser --> EntityManager #crimson
174187
175188note right on link #crimson: Accessor resides in wrong package
189+ @enduml
176190----
177191
178192[source,java]
@@ -183,8 +197,10 @@ classes().that().areAssignableTo(EntityManager.class)
183197
184198=== Annotation Checks
185199
186- [plantuml, "inheritance-annotation-check"]
200+ [plantuml, "inheritance-annotation-check", svg, opts=interactive ]
187201----
202+ @startuml
203+ hide empty members
188204skinparam componentStyle uml2
189205
190206skinparam component {
@@ -206,6 +222,7 @@ ValidPersistenceUser --> EntityManager #green
206222IllegalPersistenceUser --> EntityManager #crimson
207223
208224note right on link #crimson: Accessor is not annotated with @Transactional
225+ @enduml
209226----
210227
211228[source,java]
@@ -216,8 +233,11 @@ classes().that().areAssignableTo(EntityManager.class)
216233
217234=== Layer Checks
218235
219- [plantuml, "layer-check"]
236+ [plantuml, "layer-check", svg, opts=interactive ]
220237----
238+ @startuml
239+ hide empty members
240+ set separator none
221241skinparam componentStyle uml2
222242
223243skinparam component {
@@ -253,6 +273,7 @@ note right on link #crimson: Access goes against layers
253273
254274SomePersistenceManager -up--> SomeServiceOne #crimson
255275note right on link #crimson: Access goes against layers
276+ @enduml
256277----
257278
258279[source,java]
@@ -270,8 +291,11 @@ layeredArchitecture()
270291
271292=== Cycle Checks
272293
273- [plantuml, "cycle-check"]
294+ [plantuml, "cycle-check", svg, opts=interactive ]
274295----
296+ @startuml
297+ hide empty members
298+ set separator none
275299skinparam componentStyle uml2
276300
277301skinparam component {
@@ -301,6 +325,7 @@ ClassOneInModuleOne --> ClassTwoInModuleTwo #crimson
301325ClassOneInModuleTwo --> ClassOneInModuleThree #crimson
302326ClassTwoInModuleThree --> ClassOneInModuleOne #crimson
303327note right on link #crimson: Combination of accesses forms cycle
328+ @enduml
304329----
305330
306331[source,java]
0 commit comments