I would like to check if a package from tests exists in src. For example if my tests is in my.package.customer I would like to verify that there is a package with that name in src. So far I have tried the following query. That query would return (I hope) all there entries where at least one class a test depends on is from the same package. This would work for me. The remaining problem is that I do not know how to make this work as jqassistant constraint since the goal should fail if the count for this query is 0.
MATCH
(package:Package)-[:CONTAINS]->(classInPackage:Class),
(classInPackage:Type)-[:DECLARES]->(aMethod:Method),
(aMethod)-[:ANNOTATED_BY]->()-[:OF_TYPE]->(testAnnotationType:Type),
(classInPackage)-[DEPENDS_ON]->(anotherClass:Type:Class),
(depPackage:Package)-[:CONTAINS]->(anotherClass)
WHERE
package.fqn = depPackage.fqn
RETURN
classInPackage.fqn, anotherClass.fqn, depPackage.fqn