You don't need to pass an id in for the associated entity role. It will get one automatically after it gets created. Then you can get it for test purposes with UserEntityRole.last