LPS-51439 Prevent over compiling for test-class and test-method

Backport pull at https://github.com/brianchandotcom/liferay-portal-ee/pull/7750
Plugins' compile-test is already a macro