TMDM-7636: "relations button not list the related records"

Code clean up.
Fix proposed unit test (was failing to create a instance of record for the tests).
(https://jira.talendforge.org/browse/TMDM-7636)