Adding test for generate_payload method