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
GuptaGupta 

JSON Parsing...

setoFID = (Set<String>)JSON.deserialize(trids , Set<String>.class);

 

 

How to cover this Line in Test class, it showing (System.NullPointerException: null input to JSON parser) Error Message.

Avidev9Avidev9

Probably you are sending null in the variable "trids".

 

Try somehting like

 

Set<String> myStrings = new Set<String>{'Test1','Test2'}
trids = JSON.serialize(myStrings);