test and method for getting all groups refactored, test fails at th