private static boolean checkFunctionalMockUsage(Statement st,TestCase tc){
  if (!(st instanceof MethodStatement)) {
    return true;
  }
  MethodStatement ms=(MethodStatement)st;
  VariableReference callee=ms.getCallee();
  if (callee == null) {
    return true;
  }
  Statement source=tc.getStatement(callee.getStPosition());
  if (source instanceof FunctionalMockStatement) {
    logger.error("Mock object created at position " + source.getPosition() + " has a method called in position "+ st.getPosition());
    return false;
  }
  return true;
}

private static boolean checkFunctionalMockUsage ( Statement st , TestCase tc ) { if ( ! ( st instanceof MethodStatement ) ) { return true ; } MethodStatement ms = ( MethodStatement ) st ; VariableReference callee = ms . getCallee ( ) ; if ( callee == null ) { return true ; } Statement source = tc . getStatement ( callee . getStPosition ( ) ) ; if ( source instanceof FunctionalMockStatement ) { logger . error ( "Mock object created at position " + source . getPosition ( ) + " has a method called in position " + st . getPosition ( ) ) ; return false ; } return true ; }
no method should be called on the return value of a mock creation . this is because a functional mock object should only be used as an input value . calling any method on it would make no sense
