gateway: add test cases