master-bc-1077

https://issues.liferay.com/browse/LIFERAYQA-7547

Once again, for this pull request, the commit for master is different from ee-6.2.x/ee-6.2.10 because the ee-6.2.x/ee-6.2.10 commits also have fixes for EE-specific plugin tests. A straight cherry-pick will give you conflicts, so it'd be good to pull in master separately from ee-6.2.x/ee-6.2.10.