Skip to content

Commit

Permalink
Fix issue with generics
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmladenov committed May 8, 2024
1 parent 3c16101 commit ff50248
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ public boolean visit(FieldDeclaration fd) {

// If the field is annotated with @Mock, check if it's the class we are interested in
if (hasMockAnnotation) {
String className = fd.getType().resolveBinding().getName();
classWasMocked = className.equals(classToBeMocked);
String className = fd.getType().resolveBinding().getBinaryName();
String simpleName = className.substring(className.lastIndexOf('.') + 1);
classWasMocked = simpleName.equals(classToBeMocked);
}
}
return super.visit(fd);
Expand Down

0 comments on commit ff50248

Please sign in to comment.