Refactor userEndpointTest