Added tests for generating groups token and verifying groups.
#1328