i'm getting a bit lost in the weeds with the error I'm getting when trying to deploy this simple test class to production. In the sandbox, it compiles fine and runs fine test-wise, but when it comes time to deploy, I'm getting this specific error on line 22 when instantiating/inserting a new quote: "Constructor not defined: [Quote].< Constructor>()"
@isTest(seeAllData=true)
public class testCreatePayments {
static testMethod void insertPayments() {
//Create test data
Account acc = new Account(Name = 'testAcc');
insert acc;
Opportunity opp = new Opportunity(Name='TestOpp', AccountId = acc.Id, CloseDate = System.Today(), StageName = 'Prospecting');
insert opp;
Product2 prodtest = new Product2(Name = 'Test', IsActive = TRUE, Family = 'Buffet');
insert prodtest;
Pricebook2 stdpb = [SELECT Id FROM Pricebook2 WHERE IsStandard = true];
PricebookEntry pbentrytest = new PricebookEntry(Pricebook2Id = stdpb.Id, Product2Id = prodtest.Id, UnitPrice = 1, IsActive = TRUE, UseStandardPrice = FALSE);
insert pbentrytest;
Quote qtest = new Quote();
qtest.Name = 'test';
qtest.OpportunityId = opp.Id;
qtest.Pricebook2Id = stdpb.Id;
insert qtest;
QuoteLineItem qlineitem = new QuoteLineItem(QuoteId = qtest.Id, Quantity = 1, Product2Id = prodtest.Id, PricebookEntryId = pbentrytest.Id, UnitPrice = 1);
insert qlineitem;
Payment__c pmt = new Payment__c(quote_line_item__c = qlineitem.Id);
insert pmt;
}
}
Any ideas would be appreciated. Prior to this, I was receiving an: "Invalid constructor syntax, name=value pairs can only be used for SObjects" error, which I resolved (or thought I resolved) by passing the Quote parameters in separate lines.
The trigger this class is attempting to test is one based off of the LREngine (roll up summaries on look ups). I can post that code if needed.
Thank you in advance!