Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
  • Loading branch information
jmle committed Jun 21, 2024
1 parent dba4007 commit 2ae7f5d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
16 changes: 16 additions & 0 deletions demo-output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion rule-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,17 @@
ruleID: java-downloaded-maven-artifact
when:
java.referenced:
pattern: io.javaoperatorsdk.operator.Operator
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

0 comments on commit 2ae7f5d

Please sign in to comment.