forked from dimagi/Salesforce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tomasz Stalka
committed
Mar 2, 2017
1 parent
e002935
commit 31b4383
Showing
2 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,15 +26,15 @@ public class RenewalSubscriptionsTest { | |
List<PricebookEntry> entries = [SELECT Id, Name, ProductCode, UseStandardPrice, UnitPrice, Pricebook2Id FROM PricebookEntry]; | ||
System.debug('Entries ; ' + entries); | ||
|
||
Accounting_BillingAccount__c billingAccount1 = new Accounting_BillingAccount__c(account_type__c = 'Pro', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_1', dimagi_contact__c = '[email protected]'); | ||
Accounting_BillingAccount__c billingAccount1 = new Accounting_BillingAccount__c(Server_Name__c = 'CommCareHQ', account_type__c = 'Pro', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_1', dimagi_contact__c = '[email protected]'); | ||
insert billingAccount1; | ||
Accounting_BillingAccount__c billingAccount2 = new Accounting_BillingAccount__c(account_type__c = 'Conventional 1', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_2', dimagi_contact__c = '[email protected]'); | ||
Accounting_BillingAccount__c billingAccount2 = new Accounting_BillingAccount__c(Server_Name__c = 'CommCareHQ', account_type__c = 'Conventional 1', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_2', dimagi_contact__c = '[email protected]'); | ||
insert billingAccount2; | ||
Accounting_BillingAccount__c billingAccount3 = new Accounting_BillingAccount__c(account_type__c = 'Conventional 2', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_2', dimagi_contact__c = '[email protected]'); | ||
Accounting_BillingAccount__c billingAccount3 = new Accounting_BillingAccount__c(Server_Name__c = 'CommCareHQ', account_type__c = 'Conventional 2', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_2', dimagi_contact__c = '[email protected]'); | ||
insert billingAccount3; | ||
Accounting_BillingAccount__c billingAccount4 = new Accounting_BillingAccount__c(account_type__c = 'Conventional 3', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_2', dimagi_contact__c = '[email protected]'); | ||
Accounting_BillingAccount__c billingAccount4 = new Accounting_BillingAccount__c(Server_Name__c = 'CommCareHQ', account_type__c = 'Conventional 3', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_2', dimagi_contact__c = '[email protected]'); | ||
insert billingAccount4; | ||
Accounting_BillingAccount__c billingAccount5 = new Accounting_BillingAccount__c(account_type__c = 'Free', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_3', dimagi_contact__c = '[email protected]'); | ||
Accounting_BillingAccount__c billingAccount5 = new Accounting_BillingAccount__c(Server_Name__c = 'CommCareHQ', account_type__c = 'Free', is_active__c = true, created_by__c = '[email protected]', created_by_domain__c = 'domain_3', dimagi_contact__c = '[email protected]'); | ||
insert billingAccount5; | ||
|
||
Business_Unit__c bizUnit = new Business_Unit__c(Name = 'Test Business Unit 1'); | ||
|
@@ -44,48 +44,48 @@ public class RenewalSubscriptionsTest { | |
|
||
Account testAccount = new Account(Name = 'Test Account'); | ||
insert testAccount; | ||
Domain__c domain1 = new Domain__c(Name = 'domain_1', cpAllWebUsers__c = 30, Account__c = testAccount.Id); | ||
Domain__c domain1 = new Domain__c(Server_Name__c = 'CommCareHQ', Name = 'domain_1', cpAllWebUsers__c = 30, Account__c = testAccount.Id); | ||
insert domain1; | ||
Domain__c domain2 = new Domain__c(Name = 'domain_2', cpAllWebUsers__c = 22); | ||
Domain__c domain2 = new Domain__c(Server_Name__c = 'CommCareHQ', Name = 'domain_2', cpAllWebUsers__c = 22); | ||
insert domain2; | ||
Domain__c domain3 = new Domain__c(Name = 'domain_3', cpAllWebUsers__c = 11); | ||
Domain__c domain3 = new Domain__c(Server_Name__c = 'CommCareHQ', Name = 'domain_3', cpAllWebUsers__c = 11); | ||
insert domain3; | ||
Domain__c domain4 = new Domain__c(Name = 'domain_4', cpAllWebUsers__c = 111, Opportunity__c = opp.Id); | ||
Domain__c domain4 = new Domain__c(Server_Name__c = 'CommCareHQ', Name = 'domain_4', cpAllWebUsers__c = 111, Opportunity__c = opp.Id); | ||
insert domain4; | ||
|
||
Accounting_Softwareplan__c softwarePlan1 = new Accounting_Softwareplan__c(edition__c = 'Pro'); | ||
Accounting_Softwareplan__c softwarePlan1 = new Accounting_Softwareplan__c(Server_Name__c = 'CommCareHQ', edition__c = 'Pro'); | ||
insert softwarePlan1; | ||
Accounting_Softwareplan__c softwarePlan2 = new Accounting_Softwareplan__c(edition__c = 'Community'); | ||
Accounting_Softwareplan__c softwarePlan2 = new Accounting_Softwareplan__c(Server_Name__c = 'CommCareHQ', edition__c = 'Community'); | ||
insert softwarePlan2; | ||
Accounting_Softwareplan__c softwarePlan3 = new Accounting_Softwareplan__c(edition__c = 'Conventional'); | ||
Accounting_Softwareplan__c softwarePlan3 = new Accounting_Softwareplan__c(Server_Name__c = 'CommCareHQ', edition__c = 'Conventional'); | ||
insert softwarePlan3; | ||
|
||
Accounting_SoftwarePlanVersion__c planVersion1 = new Accounting_SoftwarePlanVersion__c(Accounting_SoftwarePlan__c = softwarePlan1.Id); | ||
Accounting_SoftwarePlanVersion__c planVersion1 = new Accounting_SoftwarePlanVersion__c(Server_Name__c = 'CommCareHQ', Accounting_SoftwarePlan__c = softwarePlan1.Id); | ||
insert planVersion1; | ||
Accounting_SoftwarePlanVersion__c planVersion2 = new Accounting_SoftwarePlanVersion__c(Accounting_SoftwarePlan__c = softwarePlan2.Id); | ||
Accounting_SoftwarePlanVersion__c planVersion2 = new Accounting_SoftwarePlanVersion__c(Server_Name__c = 'CommCareHQ', Accounting_SoftwarePlan__c = softwarePlan2.Id); | ||
insert planVersion2; | ||
Accounting_SoftwarePlanVersion__c planVersion3 = new Accounting_SoftwarePlanVersion__c(Accounting_SoftwarePlan__c = softwarePlan3.Id); | ||
Accounting_SoftwarePlanVersion__c planVersion3 = new Accounting_SoftwarePlanVersion__c(Server_Name__c = 'CommCareHQ', Accounting_SoftwarePlan__c = softwarePlan3.Id); | ||
insert planVersion3; | ||
|
||
Accounting_Subscription__c subscription1 = new Accounting_Subscription__c(is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2017, 1, 1), service_type__c = 'Implementation', is_active__c = true, | ||
Accounting_Subscription__c subscription1 = new Accounting_Subscription__c(Server_Name__c = 'CommCareHQ', is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2017, 1, 1), service_type__c = 'Implementation', is_active__c = true, | ||
Renewal_Opportunity_created__c = false, account__c = billingAccount1.Id, Accounting_subscriber_domain__c = domain1.Id, plan_version__c = planVersion1.Id); | ||
insert subscription1; | ||
Accounting_Subscription__c subscription2 = new Accounting_Subscription__c(is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2016, 11, 2), service_type__c = 'Other', is_active__c = true, | ||
Accounting_Subscription__c subscription2 = new Accounting_Subscription__c(Server_Name__c = 'CommCareHQ', is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2016, 11, 2), service_type__c = 'Other', is_active__c = true, | ||
Renewal_Opportunity_created__c = false, account__c = billingAccount2.Id, Accounting_subscriber_domain__c = domain2.Id, plan_version__c = planVersion2.Id); | ||
insert subscription2; | ||
Accounting_Subscription__c subscription3 = new Accounting_Subscription__c(is_trial__c = false, date_start__c = Date.newInstance(2016, 6, 1), date_end__c = Date.newInstance(2016, 12, 3), service_type__c = 'Other', is_active__c = true, | ||
Accounting_Subscription__c subscription3 = new Accounting_Subscription__c(Server_Name__c = 'CommCareHQ', is_trial__c = false, date_start__c = Date.newInstance(2016, 6, 1), date_end__c = Date.newInstance(2016, 12, 3), service_type__c = 'Other', is_active__c = true, | ||
Renewal_Opportunity_created__c = false, account__c = billingAccount3.Id, Accounting_subscriber_domain__c = domain2.Id, plan_version__c = planVersion2.Id); | ||
insert subscription3; | ||
Accounting_Subscription__c subscription4 = new Accounting_Subscription__c(is_trial__c = false, date_start__c = Date.newInstance(2016, 12, 3), date_end__c = Date.newInstance(2017, 1, 20), service_type__c = 'Other', is_active__c = true, | ||
Accounting_Subscription__c subscription4 = new Accounting_Subscription__c(Server_Name__c = 'CommCareHQ', is_trial__c = false, date_start__c = Date.newInstance(2016, 12, 3), date_end__c = Date.newInstance(2017, 1, 20), service_type__c = 'Other', is_active__c = true, | ||
Renewal_Opportunity_created__c = false, account__c = billingAccount4.Id, Accounting_subscriber_domain__c = domain2.Id, plan_version__c = planVersion2.Id); | ||
insert subscription4; | ||
Accounting_Subscription__c subscription5 = new Accounting_Subscription__c(is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2017, 5, 1), service_type__c = 'Product', is_active__c = true, | ||
Accounting_Subscription__c subscription5 = new Accounting_Subscription__c(Server_Name__c = 'CommCareHQ', is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2017, 5, 1), service_type__c = 'Product', is_active__c = true, | ||
Renewal_Opportunity_created__c = false, account__c = billingAccount5.Id, Accounting_subscriber_domain__c = domain3.Id, plan_version__c = planVersion3.Id); | ||
insert subscription5; | ||
Accounting_Subscription__c subscription6 = new Accounting_Subscription__c(is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2017, 1, 1), service_type__c = 'Product', is_active__c = true, | ||
Accounting_Subscription__c subscription6 = new Accounting_Subscription__c(Server_Name__c = 'CommCareHQ', is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2017, 1, 1), service_type__c = 'Product', is_active__c = true, | ||
Renewal_Opportunity_created__c = false, account__c = billingAccount5.Id, Accounting_subscriber_domain__c = domain4.Id, plan_version__c = planVersion3.Id); | ||
insert subscription6; | ||
Accounting_Subscription__c subscription7 = new Accounting_Subscription__c(is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2017, 1, 12), service_type__c = 'Product', is_active__c = true, | ||
Accounting_Subscription__c subscription7 = new Accounting_Subscription__c(Server_Name__c = 'CommCareHQ', is_trial__c = false, date_start__c = Date.newInstance(2016, 1, 1), date_end__c = Date.newInstance(2017, 1, 12), service_type__c = 'Product', is_active__c = true, | ||
Renewal_Opportunity_created__c = false, account__c = billingAccount5.Id, Accounting_subscriber_domain__c = domain4.Id, plan_version__c = planVersion3.Id); | ||
insert subscription7; | ||
|
||
|