unit testing http client exceptions