def METHOD_NAME(self, stub_broker, stub_worker, cancel_backend, state_middleware, do_work):
    stub_broker.add_middleware(Cancel(backend=cancel_backend))
    #  Pause the worker to be able to cancel the  message, and
    #   this does not been processed  when it enters the queue
    stub_worker.pause()
    msg = do_work.send()
    msg.cancel()
    stub_worker.resume()
    stub_broker.join(do_work.queue_name)
    stub_worker.join()
    state = state_middleware.backend.get_state(msg.message_id)
    assert state.status == StateStatusesEnum.Canceled
    # should not finish, since is cancelled
    assert state.end_datetime is None