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
Robert WamboldRobert Wambold 

I renamed my class and test class and now I cannot get above 72% Code Coverage.

Hello All,

I developed a simple Invocable APEX class and with my test class acheived 100% code coverage.

So...I decided to change the name and now I cannot get above 72%. The only differnce is the name of the classes. What am I doing wrong?

Thanks,

Bob

  

 

Best Answer chosen by Robert Wambold
NagendraNagendra (Salesforce Developers) 
Hi Robert,

Sorry for this issue you are facing.

The test coverage isn't maintained permanently. To regenerate your test coverage, just run all of your tests (although it is important to know that this value changes depending on if you are running it in Eclipse, etc for some reason).

To get a good idea of your code coverage, do the following:
User-added image
  • Clear Code Coverage (in red)
  • Compile all cases (in blue)
  • Run All Tests (in green)
  • Estimate your organization's code coverage (in orange)
Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Robert,

Sorry for this issue you are facing.

The test coverage isn't maintained permanently. To regenerate your test coverage, just run all of your tests (although it is important to know that this value changes depending on if you are running it in Eclipse, etc for some reason).

To get a good idea of your code coverage, do the following:
User-added image
  • Clear Code Coverage (in red)
  • Compile all cases (in blue)
  • Run All Tests (in green)
  • Estimate your organization's code coverage (in orange)
Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
This was selected as the best answer
Robert WamboldRobert Wambold

Hi Nagendra,

Thanks for your reply. I was able to get back to 100% Code Coverage by deactivating the process which called my Apex class then compiling and running tests.

User-added image

 

so...I created a change set and sent my code to Production org only to receive this message.

User-added image

My code worked perfectly in Sandbox...maybe I am overdue for a refresh of my Sandbox?

Thanks,

Bob

 

 

 

 

 

 

 

 

Robert WamboldRobert Wambold
Resolved.