0

I have a wrapper class which is not listed in "Overall Code Coverage" section of Developer Console. The wrapper class is active and is currently in use in other classes. The class was not generated through WSDLtoApex/JSOntoApex tools and was created manually. I need to check code coverage for this class.

Also, when I execute tests for classes which use my Wrapper class, the code coverage in None.

Can there be any reason for this class not showing in "Overall Code Coverage" section ?

6
  • 3
    Sometimes you need to clear your cache, as outlined here. Does this help? – sfdcfox Mar 30 '18 at 7:09
  • It didn't work. I cleared the code coverage cache and executed the test classes but still the my wrapper class is not visible. – user54240 Mar 30 '18 at 9:03
  • 1
    Can you confirm that the tests for the classes which use this wrapper execute a code path that results in invoking wrapper class methods? – David Reed Mar 30 '18 at 10:56
  • 3
    @user54240 If your Wrapper class only contains variable declaration and not any apex methods then developer console will not show your class under Overall Code Coverage. And such classes without methods doesn't require code coverage. – sfdc_sk Mar 30 '18 at 11:29
  • @sfdc_sk That was the issue!! I checked and the class contains only inner classes with variables. Thanks a lot!! – user54240 Apr 2 '18 at 9:17
2

If your Wrapper class only contains variable declaration and not any apex methods, then developer console will not show your class under Overall Code Coverage section. And such classes without methods doesn't require code coverage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.