def METHOD_NAME(mocker, status_code, json_contents, expected_is_available, expected_messages, include_source, expected_docs_url_messages):
    http_stream = MockHttpStream()
    assert isinstance(http_stream.availability_strategy, HttpAvailabilityStrategy)
    class MockResponseWithJsonContents(requests.Response, mocker.MagicMock):
        def __init__(self, *args, **kvargs):
            mocker.MagicMock.__init__(self)
            requests.Response.__init__(self, **kvargs)
            self.json = mocker.MagicMock()
    class MockSource(AbstractSource):
        def __init__(self, streams: List[Stream] = None):
            self._streams = streams
        def check_connection(self, logger: logging.Logger, config: Mapping[str, Any]) -> Tuple[bool, Optional[Any]]:
            return True, ""
        def streams(self, config: Mapping[str, Any]) -> List[Stream]:
            if not self._streams:
                raise Exception("Stream is not set")
            return self._streams
    response = MockResponseWithJsonContents()
    response.status_code = status_code
    response.json.return_value = json_contents
    mocker.patch.object(requests.Session, "send", return_value=response)
    if include_source:
        source = MockSource(streams=[http_stream])
        actual_is_available, reason = http_stream.check_availability(logger, source)
    else:
        actual_is_available, reason = http_stream.check_availability(logger)
    assert expected_is_available == actual_is_available
    if expected_is_available:
        assert reason is None
    else:
        all_expected_messages = expected_messages + expected_docs_url_messages
        for message in all_expected_messages:
            assert message in reason