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
Rajesh-InLoveWithSFdcRajesh-InLoveWithSFdc 

Test Class for ChatterMessage Transaction Security

Can anybody please share the test class for  below transaction Security Apex 


global class DisableSSNChatterMSGPolicyCondition implements TxnSecurity.PolicyCondition {
 public boolean evaluate(TxnSecurity.Event e) {
   
  String str= e.data.get('Body');
 Pattern p = Pattern.compile('(\\d{3}\\-\\d{2}-\\d{4})');
  Matcher m = p.matcher(str);

 if (m.find())
 {
  return true;
 }
 else 
 {
 return false;
 }
}
 }