[client][utils] Add tests for functions to get resource names

And fix a typo in getHostgroupName() which is detected by the test.