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
Ricardo Aguilar 4Ricardo Aguilar 4 

Unable to deploy apex class in production (Assertion Failed)

Hello,
I am trying to deploy an Apex Class in Production, but I haven't been able to succeed. The apex class runs properly in sandbox but when I deploy the code in production, I received the following error message:

System.AssertException: Assertion Failed: Expected: 2, Actual: 0 
Stack Trace: Class.CloneListTest.testCloneListControllerFive: line 159, column 1

This error message belong to a Class Name "CloneListTest" which is different from the one I'm trying to deploy.

Any help is appreciated! Regards.
 
Raj VakatiRaj Vakati
 Can you check the  test class data is the same in prod ( i mean if you are queried or applying any data logic it must return the same result 

Option 1 :- You can comment the  Assertion  and deploy 
Option 2: fix the asseting expected value and deploye 
Option 3 : If the Assertion  is failing due to data issue fix the data and deploy