Skip to content

Commit

Permalink
Improve debugging of GeneratedClassBuildItem
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Nov 25, 2024
1 parent 296ffde commit cf77459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public GeneratedClassBuildItem(boolean applicationClass, String name, byte[] cla
throw new IllegalArgumentException("Name cannot start with '/':" + name);
}
this.applicationClass = applicationClass;
this.name = name;
this.name = name.replace('/', '.');
this.classData = classData;
this.source = source;
}
Expand All @@ -39,4 +39,7 @@ public String getSource() {
return source;
}

public String toString() {
return "GeneratedClassBuildItem[" + name + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ boolean isKafkaConnector(List<ConnectorManagedChannelBuildItem> list, boolean in

assertThat(generated)
.extracting(GeneratedClassBuildItem::getName)
.extracting(n -> n.replace('/', '.'))
.allSatisfy(s -> assertThat(generatedNames).satisfiesOnlyOnce(c -> c.apply(s)));

assertThat(reflective)
.flatExtracting(ReflectiveClassBuildItem::getClassNames)
.extracting(n -> n.replace('/', '.'))
.allSatisfy(s -> assertThat(reflectiveNames).satisfiesOnlyOnce(c -> c.apply(s)));
} finally {
// must not leak the lazily-initialized Config instance associated to the system classloader
Expand Down

0 comments on commit cf77459

Please sign in to comment.