mocked http request method and added some more tests