+ Start a Discussion
baskar sanigaram 8baskar sanigaram 8 

how to write test class for inserting big object?

i want to write test class for my class where i inserted big object, i tried to give test data for big object but its showing like un supported external object.so how to resolve this,please give sample code.
baskar sanigaram 8baskar sanigaram 8
i tried  with stub api.but unable to write code,any body give sample code for that.
Raj VakatiRaj Vakati
Try to insert the Big object in test class

Customer_Interaction__b bo = new Customer_Interaction__b();
bo.Account__c = “001R000000302D3”;
bo.Game_Platform__c = “PC”;
bo.Play_Date__c = “2015-01-01T23:01:01Z”;
bo.In_Game_Purchase__c = “A12569”;
bo.Level_Achieved__c = “41”;
bo.Lives_This_Game__c = “3”;
bo.Score_This_Game__c = “5500”;
bo.Play_Duration__c = “25”;

baskar sanigaram 8baskar sanigaram 8
we cannot insert test data for bigobjects.please give stub api process to give test data
arpit vijayvergiyaarpit vijayvergiya
Hi baskar,

Can you post your Apex class code regarding the big object and the test class.

Arpit vijavergiya
arpit vijayvergiyaarpit vijayvergiya
This is a hack that can help you.
Declare List<FieldHistoryArchive1__b> fieldHistory at class level and in your test method create a list of bigobject record and instead of inserting them, assign that list to fieldHistory list and then call getValues method.

Arpit vijayvergiya
baskar sanigaram 8baskar sanigaram 8
can you give me sample code please .coz i tried it irs getting salesfrocce internal error.
baskar sanigaram 8baskar sanigaram 8
i tried like this,its showing salesforce internal error.