You need to sign in to do that
Don't have an account?
sachitanand kumar
when i deploy test class in Inbound Change Sets i got error Invalid type: OpportunityOwnerUpdate at line 16 column 42 in my test code and I don't understand why and how to fix. Below is my test code:
- @isTest
- public class OpportunityOwnerUpdate_test {
- static testMethod void data1(){
- List<Opportunity> Opportunitys = new List<Opportunity>();
- Opportunity a = New Opportunity();
- a.Name = 'myOpportunity';
- a.StageName='Stage 1 - Expressed Interest';
- a.CloseDate=date.today();
- Opportunitys.add(a);
- insert Opportunitys;
- ApexPages.StandardSetController sac = new ApexPages.StandardSetController (Opportunitys);
- sac.setSelected([SELECT Id, OwnerId FROM Opportunity LIMIT 2]);
- OpportunityOwnerUpdate aop = new OpportunityOwnerUpdate(sac);
- aop.isSelected = true;
- aop.updateOpportunity();
- }
- static testMethod void data2(){
- List<Opportunity> Opportunitys = new List<Opportunity>();
- Opportunity a = New Opportunity();
- a.Name = 'myOpportunity';
- a.StageName='Stage 1 - Expressed Interest';
- a.CloseDate=date.today();
- Opportunitys.add(a);
- insert Opportunitys;
- ApexPages.StandardSetController sac = new ApexPages.StandardSetController (Opportunitys);
- OpportunityOwnerUpdate aop = new OpportunityOwnerUpdate(sac);
- aop.isSelected = false;
- }
- }
OpportunityOwnerUpdate your Controller class. Are you adding your controller class in change set? If not, please add your test class in change set.
Thanks
All Answers
OpportunityOwnerUpdate your Controller class. Are you adding your controller class in change set? If not, please add your test class in change set.
Thanks
I think you are updating the opportunity owner in ctonroller. Please make sure the opportunity owner is valid user ID and change the test class(Add runas method) to create opportunity with correct owner.