I have developed a package which integrates two other pre-installed managed packages. The code coverage for my integration code is 96%.
When I build the package, certain objects/code from the pre-installed managed packages are included as dependent components. I want this dependency, because my integration package should only be installed in organizations which have the other two managed packages.
However, the upload fails because the code coverage drops down to 55% as a consequence of those dependent components.
Question 1: Why does the upload consider these dependent components when calculating code coverage? These components have already passed the code coverage threshold, otherwise they wouldn't be part of a managed package.
Question 2: How do I write unit tests that cover code in a (foreign) managed package?