}
@Override
public boolean visit(final MethodDeclaration node)
{
IMethodBinding meth = node.resolveBinding();
ITypeBinding mockedType = MockUtil.findMockedType(node, meth); // new MockUp< MockedType >
if ( mockedType != null )
{
boolean hasMockAnn = MockUtil.isMockMethod(meth);
boolean methodExists = findRealMethod(node, meth, mockedType) != null;
if (!hasMockAnn && methodExists )
{
addMarker(node.getName(), "Mocked method missing @Mock annotation", false);
}
if (hasMockAnn && !methodExists )
{
addMarker(node.getName(), "Mocked real method not found in type", true);
}
if (hasMockAnn && methodExists && isPrivate(meth.getModifiers()))
{
addMarker(node.getName(), "Mocked method should not be private", true);
}
}