Move test assertion out of HTTP handler.