@@ -6,7 +6,7 @@ public with sharing class DynamicSOQLDMLControllerTest {
66 insert a ;
77 a .Phone = ' 432424' ;
88 Account [] recordsToUpdate = new List <Account >{ a };
9- DynamicSOQLDMLController .executeDml (' update' , recordsToUpdate , null , null );
9+ DynamicSOQLDMLController .executeDml (' update' , JSON . serialize ( recordsToUpdate ), ' Account ' );
1010 a = [SELECT Phone FROM Account WHERE Id = : a .Id ];
1111 System .assertEquals (' 432424' , a .Phone );
1212 }
@@ -16,11 +16,8 @@ public with sharing class DynamicSOQLDMLControllerTest {
1616 // we won't test fetching cmdt
1717 DynamicSOQLDMLController .getJSFromCmdt (' Account' );
1818 String acctString = ' [{"attributes":{"type":"Account"},"Name":"Test Account"}]' ;
19- DynamicSOQLDMLController .executeDml (' insert' , null , acctString , ' Account' );
20- System .assertEquals (
21- 1 ,
22- [SELECT ID FROM Account WHERE Name = ' Test Account' ].size ()
23- );
19+ DynamicSOQLDMLController .executeDml (' insert' , acctString , ' Account' );
20+ System .assertEquals (1 , [SELECT ID FROM Account WHERE Name = ' Test Account' ].size ());
2421 }
2522
2623 @isTest
@@ -34,7 +31,7 @@ public with sharing class DynamicSOQLDMLControllerTest {
3431 accountsToUpdate .add (a1 );
3532
3633 String acctString = JSON .serialize (accountsToUpdate );
37- DynamicSOQLDMLController .executeDml (' upsert' , null , acctString , ' Account' );
34+ DynamicSOQLDMLController .executeDml (' upsert' , acctString , ' Account' );
3835 System .assertEquals (2 , [SELECT ID FROM Account ].size ());
3936 a = [SELECT Phone FROM Account WHERE Id = : a .Id ];
4037 System .assertEquals (' 432343' , a .Phone );
@@ -44,9 +41,7 @@ public with sharing class DynamicSOQLDMLControllerTest {
4441 public static void testSoql () {
4542 Account a = new Account (Name = ' Test Account' );
4643 insert a ;
47- Account [] acctsResult = DynamicSOQLDMLController .executeSoqlQuery (
48- ' Select Name from Account'
49- );
44+ Account [] acctsResult = DynamicSOQLDMLController .executeSoqlQuery (' Select Name from Account' );
5045 System .assertEquals (1 , acctsResult .size ());
5146 System .assertEquals (' Test Account' , acctsResult [0 ].Name );
5247 }
0 commit comments