1

我有一个顶点类,可以在沙盒中按我想要的方式工作。试图将其移至生产环境并需要编写一个测试类。使用了提供的示例,但在运行已转换潜在客户的测试时我继续收到错误。需要帮忙!

@isTest 
public class TestAutoConvertLeads{
    static testMethod void createnewlead() {
      User userToCreate = [Select id from user where profile.name='System Administrator' Limit 1];

      Test.startTest();    
      Lead leadToCreate =new Lead();
      List<id> Ids= New List<Id>();
      leadToCreate.ownerid= userToCreate.id;
      leadToCreate.LastName ='Gupta';
      leadToCreate.LeadSource='Partner Referral';
      leadToCreate.Rating='';
      leadToCreate.Status='';
      insert leadToCreate; 

      Ids.add(leadToCreate.id);
      AutoConvertLeads.LeadAssign(Ids);

      Test.stopTest();
   }
}

还添加了原始的顶点类:

4

0 回答 0