Skip to content

Commit

Permalink
(test) apply fix for github.com/TNG/ArchUnit/issues/413
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlermitage committed Oct 26, 2020
1 parent 76f1573 commit 4230ebf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/test/java/manon/util/ArchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ public void check(@NotNull JavaClass item, ConditionEvents events) {
public void check(@NotNull JavaClass item, ConditionEvents events) {
item.getMethods()
.forEach(method -> {
// TODO can't detect collections of forbidden objects, see https://github.com/TNG/ArchUnit/issues/413
JavaClass rawReturnType = method.getRawReturnType();
if (rawReturnType.getName().contains("manon.document.")) {
String typeName = method.reflect().getGenericReturnType().getTypeName();
if (typeName.contains("manon.document.")) {
String message = String.format("Class %s's method %s returns an entity of type %s",
item.getSimpleName(),
method.getName(),
rawReturnType.getName());
typeName);
events.add(SimpleConditionEvent.violated(method, message));
}
});
Expand Down

0 comments on commit 4230ebf

Please sign in to comment.