1

次のルールがあります。

[[junit4:C_TestMethodWithoutAssertion]]
.All Unit Tests must either use a expected Exception or call an Assert Method.
[source,cypher,role=constraint,requiresConcepts="junit4:TestClass,junit4:AssertMethod,junit4:TestMethod",severity=blocker]
----
MATCH
  (testType:Type)-[:DECLARES]->(testMethod:Test:Method)
  -[:ANNOTATED_BY]-(annotation:Annotation)-[:OF_TYPE]->(atype:Type)
WHERE
atype.fqn="org.junit.Test"
AND NOT testMethod.abstract
AND NOT (annotation)-[:HAS]->(:Value{name:"expected"})
AND NOT (testMethod)-[:INVOKES*..3]->(:Method:Assert)
RETURN
  testType AS DeclaringType,
  testMethod AS Method
----

neo4j ブラウザーで使用すると、ルールは完全に機能します。しかし、adoc ファイルのレポートに使用すると、多くの "FalsePositives" が発生します。誰にもアイデアがあります。

LGクリス

4

2 に答える 2