/classes/TenantAutomationRequestHelperTest.cls
Visual Basic for Applications | 1239 lines | 1046 code | 193 blank | 0 comment | 17 complexity | 2193de3deddb0e1494a3f83c42fb5d2d MD5 | raw file
- @isTest
- private class TenantAutomationRequestHelperTest {
-
- static Account acc;
- static Contact cntct;
- static Account partnerAccount;
- static Contact partnerContact;
- static Deployments__c deployment;
- static Customer_Tenant_Prefix__c testPrefix;
- static Deployment_Contact__c depContact ;
- static WTA_Customer_Tenant__c provisionedtenant;
- static WTA_Customer_Tenant__c activetenant;
- static User u,testCustomerUser ;
-
- static {
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- acc = TEST_DB_Core.getAccount('Customer');
- cntct = TEST_DB_Core.getContact(acc, 'Prospect/Customer Contact');
- testCustomerUser = Test_DB_Core.getNewUser('Workday - Customer Portal Profile', 'CustomerPortal');
- List<User> testUsers = [Select Id, contactid, accountid, username from user where isactive=true and contactid!=null and accountid!=null and id=:testCustomerUser.Id limit 1];
- cntct = new Contact(id = testUsers[0].ContactId);
- cntct.Contact_Status__c = 'Active';
- update cntct;
-
- partnerAccount = TEST_DB_Core.getAccount('Partner');
- partnerAccount.Type='Partner';
- partnerAccount.Name='ABC';
-
- partnerContact = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- partnerContact.Contact_Status__c='Active';
- //partnerContact.Contact_Type__c='Partner';
- partnerContact.Primary_Main_Contact__c=true;
- update partnerContact;
- u = TEST_DB_Core.getNewUser(partnerContact, 'Gold Workday Partner Profile', 'PartnerPortal');
-
- partnerAccount.Account_Status__c='Active';
- update partnerAccount;
-
- deployment = new Deployments__c();
- deployment.Customer__c = acc.Id;
- deployment.Priming_Partner__c=partnerAccount.Id;
- deployment.Overall_Status__c='Active';
- deployment.Deployment_Type__c='Post Go Live';
- insert deployment;
-
- depContact = new Deployment_Contact__c();
- depContact.Deployment__c = deployment.Id;
- depContact.Contact__c = partnerContact.Id;
- depContact.Contact_Type__c='Partner';
- depContact.Contact_Role__c='Principal Consultant';
- depContact.Authorized_for_Tenant_Changes__c='YES';
- depContact.Contact_State__c='Active';
- depContact.WTA_Email_Notification__c=true;
- insert depContact;
-
- WTA_Tenant_Type__c wtaTenty = new WTA_Tenant_Type__c();
- wtaTenty.name= 'Implementation Preview';
- wtaTenty.Active__c=True;
- wtaTenty.Code__c='IMPL';
- wtaTenty.Sort_Order__c=5;
- insert wtaTenty;
-
- WTA_Tenant_Type__c wtaTenty2 = new WTA_Tenant_Type__c();
- wtaTenty2.name= 'Implementation Preview';
- wtaTenty2.Active__c=True;
- wtaTenty2.Code__c='PROD';
- wtaTenty2.Sort_Order__c=5;
- insert wtaTenty2;
-
- WTA_Tenant_Type__c wtaTenty3 = new WTA_Tenant_Type__c();
- wtaTenty3.name= 'Implementation Preview';
- wtaTenty3.Active__c=True;
- wtaTenty3.Code__c='SANDBOX';
- wtaTenty3.Sort_Order__c=5;
- insert wtaTenty3;
-
- WTA_Data_Center__c dc = new WTA_Data_Center__c();
- dc.Name='Atlanta';
- dc.Data_Center_Code__c='DUB';
- insert dc;
- /*
- Customer_Release_Wave__c relWave = new Customer_Release_Wave__c();
- relWave.Account__c = acc.id;
- relWave.Release__c = '300';
- relWave.Waves__c = 'Wave 0';
- insert relWave; */
- }
-
- static testMethod void myUnitTest() {
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumant
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
- Tenant_Automation_Request__c req = new Tenant_Automation_Request__c();
- req.Tenant_Management_Area__c=WTA_Helper.SFTP_CREATE_SITE;
- req.Destination_Tenant__c=provisionedtenant.Id;
- req.Status__c='Submitted';
- req.Due_Date__c= Date.newInstance(2020, 1, 1);
- req.Customer__c = acc.Id;
- req.Request_Number__c='TAR-898988';
- req.Origin__c='Customer Portal';
- req.End_Point__c =null;
- req.User_Name__c =null;
- insert req;
-
- req.End_Point__c = 'sftp-impl.workday.com';
- req.sFTP_Site_Name__c = 'discover-HCM';
- req.User_Name__c ='redrobin2';
- req.Status__c = 'Cancelled';
- req.Tenant_Management_Area__c = 'SFTP – Create Site';
- update req;
-
- Tenant_Automation_Request_Team__c team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req.Id;
- team.User__c = u.Id;
- insert team;
-
- req.Due_Date__c= Date.newInstance(2020, 2, 1);
- req.status__c='Complete';
- update req;
-
- req.status__c='Cancelled';
- update req;
-
- test.stopTest();
- }
-
-
-
- static testmethod void NewUnitTest8() {
- //line 438
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumant
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.PRODUCTION_END_ACTIVE_SESSIONS;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898989';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- system.debug('==team==' + team + '==id==' + team.id);
-
- req2.End_Point__c = 'wd6-impl-sftp.workday.com';
- req2.sFTP_Site_Name__c = 'discover-HCM';
- req2.User_Name__c ='redrobin4';
- req2.Status__c = 'Completed';
- req2.Tenant_Management_Area__c = wta_helper.PRODUCTION_END_ACTIVE_SESSIONS;
- update req2;
- }
-
- test.stopTest();
- }
-
- static testmethod void NewUnitTest9() {
- //line 452
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request'; //sumanth
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.PRODUCTION_END_ACTIVE_SESSIONS;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898989';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- system.debug('==team==' + team + '==id==' + team.id);
-
- req2.End_Point__c = 'wd6-impl-sftp.workday.com';
- req2.sFTP_Site_Name__c = 'discover-HCM';
- req2.User_Name__c ='redrobin4';
- req2.Status__c = 'Completed';
- req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- update req2;
- }
-
- test.stopTest();
- }
-
- static testmethod void SandboxPreviewRefrshExemption() {
-
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumanth
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.SANDBOX_PREVIEW_REFRESH_EXEMPTION;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898999';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team,team1;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team1 = new Tenant_Automation_Request_Team__c();
- team1.Tenant_Automation_Request__c=req2.Id;
- team1.User__c = testCustomerUser.id;
- insert team1;
-
- List<Tenant_Automation_Request_Team__c> teamList =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- //system.debug('==team==' + teamList.size + '==id==' + teamList);
-
- req2.Status__c = 'Completed';
- // req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- update req2;
- req2.status__c='Cancelled';
- update req2;
- }
-
- test.stopTest();
- }
-
- static testmethod void SandboxPreviewRefresh() {
-
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumanth
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.SANDBOX_PREVIEW_REFRESH;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898999';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team,team1;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team1 = new Tenant_Automation_Request_Team__c();
- team1.Tenant_Automation_Request__c=req2.Id;
- team1.User__c = testCustomerUser.id;
- insert team1;
-
- List<Tenant_Automation_Request_Team__c> teamList =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- //system.debug('==team==' + teamList.size + '==id==' + teamList);
-
- req2.Status__c = 'Completed';
- // req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- update req2;
- req2.status__c='Cancelled';
- update req2;
- }
-
- test.stopTest();
- }
-
- static testmethod void tenant_operations() {
-
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumanth
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.TENANT_OPERATIONS;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898999';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- req2.ADP_TAR__c = false;
- req2.Tenant_Action__c = 'Tenant Rename';
- req2.Destination_Tenant_Type__c = 'Implementation';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team,team1;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team1 = new Tenant_Automation_Request_Team__c();
- team1.Tenant_Automation_Request__c=req2.Id;
- team1.User__c = testCustomerUser.id;
- insert team1;
-
- List<Tenant_Automation_Request_Team__c> teamList =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- //system.debug('==team==' + teamList.size + '==id==' + teamList);
-
- req2.Status__c = 'Completed';
- // req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- update req2;
- req2.status__c='Cancelled';
- update req2;
- }
-
- test.stopTest();
- }
-
-
- static testmethod void NewUnitTest10() {
- //line 462
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumanth
-
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.PRODUCTION_END_ACTIVE_SESSIONS;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898989';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- system.debug('==team==' + team + '==id==' + team.id);
-
- req2.End_Point__c = 'wd6-impl-sftp.workday.com';
- req2.sFTP_Site_Name__c = 'discover-HCM';
- req2.User_Name__c ='redrobin4';
- req2.Status__c = 'Cancelled';
- req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- update req2;
- }
-
- test.stopTest();
- }
-
- static testmethod void NewUnitTest11() {
- //line 473
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumant
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.PRODUCTION_END_ACTIVE_SESSIONS;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898989';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- system.debug('==team==' + team + '==id==' + team.id);
- TenantAutomationRequestHelper.tntMode = '';
- req2.End_Point__c = 'wd6-impl-sftp.workday.com';
- req2.sFTP_Site_Name__c = 'discover-HCM';
- req2.User_Name__c ='redrobin4';
- req2.Status__c = 'Submitted';
- req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- req2.Sandbox_Request_Cancelled__c = null;
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Previous_Excemption_Count__c = 2;
- req2.JIRA_Id__c = 'TAR-test';
- req2.Integration_Status__c = 'Success';
- update req2;
- }
-
- test.stopTest();
- }
-
-
- static testmethod void NewUnitTest12() {
- //line 484
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumant
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.PRODUCTION_END_ACTIVE_SESSIONS;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898989';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- system.debug('==team==' + team + '==id==' + team.id);
- TenantAutomationRequestHelper.tntMode = '';
- req2.End_Point__c = 'wd6-impl-sftp.workday.com';
- req2.sFTP_Site_Name__c = 'discover-HCM';
- req2.User_Name__c ='redrobin4';
- req2.Status__c = 'Submitted';
- req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- req2.Sandbox_Request_Cancelled__c = null;
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Previous_Excemption_Count__c = 1;
- req2.JIRA_Id__c = 'TAR-test';
- req2.Integration_Status__c = 'Success';
- update req2;
- }
-
- test.stopTest();
- }
-
- static testmethod void NewUnitTest13() {
- //line 499
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumant
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.PRODUCTION_END_ACTIVE_SESSIONS;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Pending';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898989';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- req2.Sandbox_Request_Cancelled__c = null;
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- system.debug('==team==' + team + '==id==' + team.id);
- TenantAutomationRequestHelper.tntMode = 'Edit';
- req2.End_Point__c = 'wd6-impl-sftp.workday.com';
- req2.sFTP_Site_Name__c = 'discover-HCM';
- req2.User_Name__c ='redrobin4';
- req2.Status__c = 'Pending';
- req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- req2.Sandbox_Request_Cancelled__c = null;
- req2.Due_Date__c= (Date.newInstance(2020, 1, 1)) + 2000;
- req2.Previous_Excemption_Count__c = 2;
- update req2;
- }
-
- test.stopTest();
- }
-
- static testmethod void NewUnitTest14() {
- //line 512
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumant
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.PRODUCTION_END_ACTIVE_SESSIONS;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Pending';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898989';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- req2.Sandbox_Request_Cancelled__c = null;
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- system.debug('==team==' + team + '==id==' + team.id);
- TenantAutomationRequestHelper.tntMode = 'Edit';
- req2.End_Point__c = 'wd6-impl-sftp.workday.com';
- req2.sFTP_Site_Name__c = 'discover-HCM';
- req2.User_Name__c ='redrobin4';
- req2.Status__c = 'Pending';
- req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- req2.Sandbox_Request_Cancelled__c = null;
- req2.Due_Date__c= (Date.newInstance(2020, 1, 1)) + 2000;
- req2.Previous_Excemption_Count__c = 2;
- update req2;
- }
-
- test.stopTest();
- }
-
- static testmethod void NewTest12() {
- //line 365 - else block
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
-
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- Case cse = new Case();
- cse.AccountId = acc.Id;
- cse.contactId = cntct.id;
- cse.Case_Type__c = 'Customer Care Request';//sumant
- insert cse;
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- //****Create User******
- Contact partnerContact2 = TEST_DB_Core.getContact(partnerAccount, 'Partner Contact');
- Profile p = [select p.Id from Profile p where p.Name = 'System Administrator'];
- string username = 'user1@workdayinc.com.testcoverage';
- User u2 = new User(
- Username = username,
- Email = username,
- Alias = 'Atester',
- LastName = 'user1Nametester',
- EmailEncodingKey = 'UTF-8',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'GMT',
- ProfileId = p.Id
- );
- //u2.ContactId=partnerContact2.Id;
- insert u2;
- system.debug('==u2==' + u2);
- //****Create User******
-
- system.runAs(u2)
- {
- TenantAutomationRequestHelper.tntMode ='Edit';
- Tenant_Automation_request__c req2 = new Tenant_Automation_request__c();
- req2.Tenant_Management_Area__c=wta_helper.TENANT_ACCESS_IMPLEMENTER;
- req2.Destination_Tenant__c=provisionedtenant.Id;
- req2.Status__c='Submitted';
- req2.Due_Date__c= Date.newInstance(2020, 1, 1);
- req2.Customer__c = acc.Id;
- req2.request_Number__c='TAR-898989';
- req2.Origin__c='Customer Portal';
- req2.End_Point__c ='wd5-impl-sftp.workday.com';
- req2.User_Name__c ='redrobin3';
- insert req2;
- system.debug('==insert req2==' + req2 + '==created by id' + req2.CreatedById);
-
- // user u2 = [select id,email from user where id =: req2.CreatedById];
- // u2.email = 'test22@test22.com';
- // update u2;
- Tenant_Automation_Request_Team__c team;
-
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req2.Id;
- team.User__c = u2.id;
- insert team;
-
- team =[Select User__c, Tenant_Automation_Request__c, Id, User__r.UserType, User__r.Id, User__r.UserName,User__r.Email From Tenant_Automation_Request_Team__c where Tenant_Automation_Request__c =: req2.Id];
- system.debug('==team==' + team + '==id==' + team.id);
- TenantAutomationRequestHelper.tntMode = '';
- req2.End_Point__c = 'wd6-impl-sftp.workday.com';
- req2.sFTP_Site_Name__c = 'discover-HCM';
- req2.User_Name__c ='redrobin4';
- req2.Status__c = 'Submitted';
- //req2.Tenant_Management_Area__c = wta_helper.SANDBOX_REFRESH_EXEMPTION;
- req2.Sandbox_Request_Cancelled__c = null;
- req2.Due_Date__c= (Date.newInstance(2020, 1, 1)) + 2000;
- req2.Sandbox_Request_Cancelled__c = null;
- req2.Previous_Excemption_Count__c = 2;
- update req2;
- }
-
- test.stopTest();
- }
-
-
-
-
-
- /*
- static testMethod void myUnitTestSandboxRefreshExemption() {
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
-
- Tenant_Automation_Request__c req = new Tenant_Automation_Request__c();
- req.Tenant_Management_Area__c=WTA_Helper.SANDBOX_REFRESH_EXEMPTION;
- req.Destination_Tenant__c=provisionedtenant.Id;
- req.Status__c='Submitted';
- req.Due_Date__c= Date.newInstance(2020, 1, 1);
- req.Customer__c = acc.Id;
- req.Request_Number__c='TAR-898987';
- req.Origin__c='Customer Portal';
- req.Previous_Excemption_Count__c=0;
- req.End_Point__c = 'sftp-impl.workday.com';
- insert req;
-
-
- Tenant_Automation_Request_Team__c team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req.Id;
- team.User__c = u.Id;
- insert team;
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req.Id;
- team.User__c = UserInfo.getUserId();
-
- insert team;
-
- req.Previous_Excemption_Count__c=1;
- req.Due_Date__c= Date.newInstance(2020, 2, 1);
- update req;
-
- System.debug('req.status :: '+req.status__c);
-
- req.status__c='Completed';
- update req;
- System.debug('req.status :: '+req.status__c);
-
- req.status__c='Cancelled';
- update req;
- System.debug('req.status :: '+req.status__c);
-
- test.stopTest();
-
- }
- */
- /*
- static testMethod void myUnitTestSandboxRefreshExemption2nd() {
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- Tenant_Automation_Request__c req = new Tenant_Automation_Request__c();
- req.Tenant_Management_Area__c=WTA_Helper.SANDBOX_REFRESH_EXEMPTION;
- req.Destination_Tenant__c=provisionedtenant.Id;
- req.Status__c='Submitted';
- req.Due_Date__c= Date.newInstance(2020, 1, 1);
- req.Customer__c = acc.Id;
- req.Request_Number__c='TAR-898987';
- req.Origin__c='Customer Portal';
- req.Previous_Excemption_Count__c=2;
- req.End_Point__c = 'sftp-impl.workday.com';
- insert req;
-
- Tenant_Automation_Request_Team__c team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req.Id;
- team.User__c = u.Id;
- insert team;
- team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req.Id;
- team.User__c = UserInfo.getUserId();
-
- insert team;
-
- req.Status__c='Submitted';
- req.Due_Date__c= Date.newInstance(2019, 2, 1);
- //req.Sandbox_Request_Cancelled__c=null;
- update req;
-
- req.Status__c='Submitted';
- req.Due_Date__c= Date.newInstance(2019, 3, 1);
- req.Sandbox_Request_Cancelled__c=null;
- req.Previous_Excemption_Count__c=2;
- update req;
-
- System.debug('req.status :: '+req.status__c);
-
- req.status__c='Completed';
- update req;
- System.debug('req.status :: '+req.status__c);
-
- req.status__c='Cancelled';
- update req;
- System.debug('req.status :: '+req.status__c);
- req.Status__c='Submitted';
- req.Due_Date__c= Date.newInstance(2019, 4, 1);
- req.Sandbox_Request_Cancelled__c=null;
- req.Previous_Excemption_Count__c=2;
- update req;
-
- req.status__c='Cancelled';
- update req;
-
- req.Status__c='Submitted';
- req.Due_Date__c= Date.newInstance(2019, 5, 1);
- req.Sandbox_Request_Cancelled__c=null;
- req.Previous_Excemption_Count__c=1;
- update req;
-
- test.stopTest();
-
- }
- */
- /*
- static testMethod void myUnitTestProdKillSession() {
- List<Data_Migration__c> dmlist = Test_DB_Core.dm();
- for(Data_Migration__c dm : dmlist ){
- dm.Exclude_Triggers__c = true;
- }
- update dmlist;
- WTACustomerTenantTriggerHelper.skipTrigger = true;
- test.startTest();
-
- provisionedtenant = WTA_Generate_Test_Data.getTenant(acc, 'IMPL','','DUB','1',false,'Provisioned','PROD');
- activetenant = WTA_Generate_Test_Data.getTenant(acc, 'PROD','','DUB','',true,'Active','PROD');
-
- Tenant_Automation_Request__c req = new Tenant_Automation_Request__c();
- req.Tenant_Management_Area__c=WTA_Helper.PRODUCTION_END_ACTIVE_SESSIONS;
- req.Destination_Tenant__c=provisionedtenant.Id;
- req.Status__c='Submitted';
- req.Due_Date__c= Date.newInstance(2020, 1, 1);
- req.Customer__c = acc.Id;
- req.Request_Number__c='TAR-898987';
- //req.Origin__c='Customer Portal';
- insert req;
-
- Tenant_Automation_Request_Team__c team = new Tenant_Automation_Request_Team__c();
- team.Tenant_Automation_Request__c=req.Id;
- team.User__c = u.Id;
- insert team;
-
- req.Due_Date__c= Date.newInstance(2020, 2, 1);
- update req;
-
- req.status__c='Completed';
- update req;
-
- req.status__c='Cancelled';
- update req;
-
- test.stopTest();
- }
- */
- }