diff --git a/demo-output.yaml b/demo-output.yaml index 5acd8cd3..905b88ae 100644 --- a/demo-output.yaml +++ b/demo-output.yaml @@ -912,6 +912,22 @@ matchingXML: "" effort: 1 insights: + java-annotation-inspection-01: + description: | + This rule looks for a certain class annotated with a certain annotation + labels: + - tag=Java Operator SDK + incidents: + - uri: file:///examples/java/example/src/main/java/com/example/apps/Bean.java + message: "" + codeSnip: " 1 package com.example.apps;\n 2 \n 3 import javax.ejb.SessionBean;\n 4 import javax.ejb.Singleton;\n 5 \n 6 @Singleton\n 7 public abstract class Bean implements SessionBean {\n 8 \n 9 }\n" + lineNumber: 7 + variables: + containerName: Bean + file: file:///examples/java/example/src/main/java/com/example/apps/Bean.java + kind: Class + name: Singleton + package: com.example.apps java-downloaded-maven-artifact: description: | This rule tests the application downloaded from maven artifact diff --git a/rule-example.yaml b/rule-example.yaml index 67bfb04c..93b4b5a6 100644 --- a/rule-example.yaml +++ b/rule-example.yaml @@ -329,4 +329,17 @@ ruleID: java-downloaded-maven-artifact when: java.referenced: - pattern: io.javaoperatorsdk.operator.Operator \ No newline at end of file + pattern: io.javaoperatorsdk.operator.Operator +- category: mandatory + description: | + This rule looks for a certain class annotated with a certain annotation + tag: + - Java Operator SDK + ruleID: java-annotation-inspection-01 + when: + java.referenced: + pattern: com.example.apps* + location: CLASS + annotated: + pattern: javax.ejb.SessionBean +