Class PlantUmlArchCondition

java.lang.Object
com.tngtech.archunit.lang.ArchCondition<JavaClass>
com.tngtech.archunit.library.plantuml.PlantUmlArchCondition

public class PlantUmlArchCondition extends ArchCondition<JavaClass>
Allows to evaluate PlantUML Component Diagrams as ArchUnit rules.

The general syntax to use is


 classes().should(adhereToPlantUmlDiagram(someDiagramUrl, consideringAllDependencies()));
 
The supported diagram syntax uses component diagram stereotypes to associate package patterns (compare PackageMatcher) with components. An example could look like

 [Some Source] <<..some.source..>>
 [Some Target] <<..some.target..>>

 [Some Source] --> [Some Target]
 
Applying such a diagram as an ArchUnit rule would demand dependencies only from ..some.source.. to ..some.target.., but forbid them vice versa.
There are various factory method for different input formats (file, url, ...), compare Which dependencies should be considered by the rule can be configured via PlantUmlArchCondition.Configuration. Candidates are
A PlantUML diagram used with ArchUnit must abide by a certain set of rules:
  1. Components must have a name
  2. Components must have at least one stereotype. Each stereotype in the diagram must be unique
  3. Components may have an optional alias
  4. Components may have an optional color
  5. Components must be defined before declaring dependencies
  6. Dependencies must use arrows only consisting of dashes, pointing right, e.g. -->