Skip to content

Commit

Permalink
[KOGITO-8525] Making plain Java test work
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Jul 6, 2023
1 parent 1dce3c4 commit a210c83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,5 @@ default Expression getOptionalInstance(String fieldName) {

default <T extends NodeWithAnnotations<?>> T withTagAnnotation(T node, NodeList<MemberValuePair> attributes) {
return node;
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ private TagResourceGenerator() {
* @param process the {@link KogitoWorkflowProcess} to get the tags from
*/
static void addTags(CompilationUnit compilationUnit, KogitoWorkflowProcess process, KogitoBuildContext context) {
Map<String, Object> metadata = process.getMetaData();
@SuppressWarnings("unchecked")
Collection<String> tags = (Collection<String>) metadata.getOrDefault(Metadata.TAGS, Set.of());
String description = (String) metadata.get(Metadata.DESCRIPTION);
compilationUnit.findAll(ClassOrInterfaceDeclaration.class)
.forEach(cls -> addTags(process, tags, description, cls, context));
if (context.hasDI()) {
Map<String, Object> metadata = process.getMetaData();
@SuppressWarnings("unchecked")
Collection<String> tags = (Collection<String>) metadata.getOrDefault(Metadata.TAGS, Set.of());
String description = (String) metadata.get(Metadata.DESCRIPTION);
compilationUnit.findAll(ClassOrInterfaceDeclaration.class)
.forEach(cls -> addTags(process, tags, description, cls, context));
}
}

private static void addTags(KogitoWorkflowProcess process, Collection<String> tags, String description, ClassOrInterfaceDeclaration cls, KogitoBuildContext context) {
Expand Down

0 comments on commit a210c83

Please sign in to comment.