Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix @Mock annotation support #270

Merged
merged 4 commits into from
May 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix issue with generics
  • Loading branch information
martinmladenov committed May 8, 2024
commit ff50248294fc51d839048cc5bfa97133a5b97aa6
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
Loading