If you are not familiar with Degraph yet I recommend to read the Degraph documentation first and to have a look at my degraph-visualization-test demo.
This is a sample project which uses degraph-check
to write unit tests that check package dependencies.
The package dependencies of this project look like this:
This project mainly demonstrates
- which project dependencies are needed (Degraph, Hamcrest and JUnit)
to write dependecy tests with Degraph
[see pom.xml] - simple usage examples of the Degraph Java Constraints DSL
[see PackageDependenciesTest]
Links
- Degraph
- Degraph - Testing of Dependencies
Pro Tip
If you run into an IllegalArgumentException
while testing your code base, you possibly have the wrong asm
version on your classpath (see Degraph issue #82). In this case the easiest workaround is to move the degraph tests into a separate module.