replace testing flag with mock