from messagebus import (
    Message,
    MessageBusException,
)
from ._SendMessageRequestValidator import SendMessageRequestValidator


class SendMessageMock(object):
    def __init__(
        self,
        request_validator: SendMessageRequestValidator,
        response: [Message, MessageBusException],
    ):

        self.request_validator = request_validator
        self.response = response

    def is_valid_for(
        self,
        to_component: str,
        message: Message
    ) -> bool:

        return self.request_validator.is_valid_for(
            to_component=to_component,
            message=message,
        )
