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
Besides the code example below, you can find the complete JavaDoc of the libraries API [here](https://www.javadoc.io/doc/org.contextmapper/context-mapper-archunit-extension/latest/index.html).
28
+
26
29
### Use all our test cases
27
30
The simplest way to apply all our test predefined test cases is to extend our `AbstractTacticArchUnitTest`. An example:
28
31
@@ -89,6 +92,8 @@ public class ExampleArchitectureTest {
89
92
90
93
The three example tests above ensure that Aggregates, Entities, and Value Objects that exist in the Java code, also exist in the CML model. In case a developer adds an Aggregate, Entity, or Value Object to the code that is not part of the CML model, the test will fail.
91
94
95
+
The example above uses our predefined rules based on the jMolecules annotations. You can find all available rules [here](https://www.javadoc.io/doc/org.contextmapper/context-mapper-archunit-extension/latest/org/contextmapper/archunit/ContextMapperJMoleculesArchRules.html). The next section shows how you can write your own rules, in case you don't want to use jMolecules.
96
+
92
97
### Use custom annotations
93
98
By using only our ArchCondition's it is also possible to implement the tests with other annotations than JMolecules:
94
99
@@ -125,9 +130,11 @@ public class ExampleArchitectureTest {
125
130
}
126
131
```
127
132
133
+
As the example illustrates, in this case you are able to select your classes with your own code (using your own annotations); but you can still use our conditions, that check specific things in the CML model. You can find all conditions that are currently available [here](https://www.javadoc.io/doc/org.contextmapper/context-mapper-archunit-extension/latest/org/contextmapper/archunit/ContextMapperArchConditions.html).
134
+
128
135
## Available Rules and Conditions
129
136
_Hint:_ The available rules are implemented with the jMolecules DDD annotations. However, you can implement the same rules with your
130
-
own set of annotations or interfaces by using the corresponding ArchUnit conditions.
137
+
own set of annotations or interfaces by using the corresponding ArchUnit conditions (as documented above).
@@ -143,6 +150,8 @@ own set of annotations or interfaces by using the corresponding ArchUnit conditi
143
150
|`valueObjectsShouldAdhereToCmlValueObjectStructure`| This rule ensures that the fields of a value object in the code (for example annotated with @ValueObject jMolecules annotation) are also modeled in the corresponding CML value object. |
144
151
|`domainEventsShouldAdhereToCmlDomainEventStructure`| This rule ensures that the fields of a domain event in the code (for example annotated with @DomainEvent jMolecules annotation) are also modeled in the corresponding CML domain event. |
145
152
153
+
The rules and conditions are documented in [our JavaDoc](https://www.javadoc.io/doc/org.contextmapper/context-mapper-archunit-extension/latest/index.html) as well.
154
+
146
155
**Missing some rules/conditions?** Contributions are always welcome! Create PRs or GitHub issues with your ideas/requirements.
0 commit comments