LPS-51439 Extract junit calls as a macro to reduce duplicate code

Backport pull at https://github.com/brianchandotcom/liferay-portal-ee/pull/7772
Plugins only has one <junit> call, and its content is different from portal, I don't think making it as the same macro will do us any good, just making thing hard to read.
But if you do want a consistent structure, I can change it to macro too.