def METHOD_NAME(stub_broker, stub_worker, cancel_backend, cancel):
    # Given a cancel backend
    # And a broker with the cancel middleware
    stub_broker.add_middleware(Cancel(backend=cancel_backend))
    has_been_called = []
    # And an actor
    @remoulade.actor()
    def do_work():
        has_been_called.append(1)
    # And this actor is declared
    stub_broker.declare_actor(do_work)
    # When I send that actor a message
    message = do_work.message()
    # If I cancel the message
    if cancel:
        message.cancel()
    stub_broker.enqueue(message)
    stub_broker.join(do_work.queue_name)
    stub_worker.join()
    # It should not be called
    assert bool(has_been_called) != cancel