function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sumit dsumit d 

Malformed JSON: Expected '[' at the beginning of List/Set in test class

Hi All,
 I have created a test class which is giving me following error:-Malformed JSON: Expected '[' at the beginning of List/Set 
How to resolve it ?
My class and test class is given below:- 
public with sharing class ParticipationController {
public static string updateParticipations(Object data) {
    List<bre__BR_Participation__c> ParticipationsForUpdate = (List<bre__BR_Participation__c>) JSON.deserialize(
    try {
        update ParticipationsForUpdate;
        return 'Success: Participation updated successfully';
    catch (Exception e) {
        return 'The following exception has occurred: ' + e.getMessage();

My test class is given below:-
public with sharing class ParticipationControllerTest {
        static testmethod void updateParticipationTest() {
        bre__BR_Event__c ev = new bre__BR_Event__c();
        ev.bre__Start_Date__c =;
        insert ev;
        bre__BR_Participation__c data = new bre__BR_Participation__c();
        data.bre__BR_Event__c =;
        insert data;
        data.Participated__c = true;
        update data;
VinayVinay (Salesforce Developers) 
Hi Sumit,

Data is already a string you no need to change this and try to remove below line and see.