implement auto-mock feature