Add unit tests around http messaging