Blog

isTest(SeeAllData=True) Annotation

  1. If a test class is annotated with the @IsTest(SeeAllData=true) keyword, the
    SeeAllData keyword is applied to all test methods that do not explicitly set the
    SeeAllData keyword. When applied at the class or method level, the
    @IsTest(SeeAllData=true) annotation allows data access.
  2. Annotating a method with @IsTest(SeeAllData=false) is ignored if the containing
    class has been annotated with @IsTest(SeeAllData=true).
  3. In this situation, that approach still has access to all of the organization's data. An
    @IsTest(SeeAllData=true) annotation on a method overrides a
    @IsTest(SeeAllData=false) annotation on the class.
  4. The annotations @IsTest(SeeAllData=true) and @IsParallel=true cannot be used on
    the same Apex method.