Skip to content

Commit

Permalink
Fix bug in @mock
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmladenov committed May 8, 2024
1 parent 4d39350 commit 3c16101
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ 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().toString();
classWasMocked = className.contains(classToBeMocked);
String className = fd.getType().resolveBinding().getName();
classWasMocked = className.equals(classToBeMocked);
}
}
return super.visit(fd);
Expand Down

0 comments on commit 3c16101

Please sign in to comment.