[FORWARD PORT] LPS-50773 add tests

This is a (partial) forward port of https://github.com/brianchandotcom/liferay-plugins-ee/pull/9418.

See the rest in plugins: https://github.com/brianchandotcom/liferay-plugins/pull/3875

Thanks!