def METHOD_NAME(backend):
    handler = MagicMock()
    backend._message_handlers = {"beep": handler}
    socket = MagicMock()
    message = MagicMock()
    message.getTypeName = MagicMock(return_value = "beep")
    socket.takeNextMessage = MagicMock(return_value = message)
    backend._socket = socket
    backend._onMessageReceived()
    handler.assert_called_once_with(message)