[
  {
    "comment": "activate service, create account, login",
    "include": "new_account",
    "params": {
      "email": "user-account-deletion@example.com",
      "verifyEmail": "true"
    }
  },

  {
    "comment": "look up account policy",
    "request": { "uri": "users/{{user.uuid}}/policy" },
    "response": {
      "store": "policy",
      "check": [
        {"condition": "json.getAccountContacts() != null"},
        {"condition": "json.getAccountContacts().length == 1"}
      ]
    }
  },

  {
    "comment": "set deletion policy to full_delete",
    "request": {
      "uri": "users/{{user.uuid}}/policy",
      "data": "policy",
      "entity": {
        "deletionPolicy": "full_delete"
      }
    },
    "response": {
      "store": "policy",
      "check": [
        {"condition": "json.getDeletionPolicy().name() == 'full_delete'"}
      ]
    }
  },

  {
    "comment": "lookup user - just checking it is the one for deletion",
    "request": { "uri": "users/{{user.uuid}}" },
    "response": { "check": [{ "condition": "json.getName() == 'user-account-deletion@example.com'" }] }
  },

  {
    "comment": "as root, delete account",
    "request": {
      "session": "rootSession",
      "uri": "users/{{user.uuid}}",
      "method": "delete"
    }
  },

  {
    "comment": "lookup user, expect not found",
    "request": {
      "uri": "users/{{user.uuid}}"
    },
    "response": { "status": 404 }
  }
]
