Refactor http test cases