 defmodule HELM.Entity.BrokerTest do
-  use ExUnit.Case, async: false
+  use ExUnit.Case
 
   require Logger
 

    assert entity.account_id == account_id
  end

  test "direct entity creation", %{pid: pid, payload: payload} do
    # This tester listens to event:acount:created casts
    Tester.listen(pid, :cast, :test_entity_creation2, "event:account:created")
    Tester.listen(pid, :cast, :test_entity_creation2, "event:entity:created")

    # Try to create the user
    {:ok, entity} = Broker.call("entity:create", %{account_id: payload.email})

    # cache the account id
    entity_id = entity.entity_id


  setup do
    {:ok, _} = Application.ensure_all_started(:helf_broker)
    {:ok, _} = Application.ensure_all_started(:entity)
    {:ok, _} = Application.ensure_all_started(:account)

    # account email
    email = "entity@test01.com"
    puuid = "pseudo-uuid"

    with {:ok, account} <- Account.Controller.find(email),
         Account.Controller.remove_account(account),
         {:ok, entity} <- Entity.Controller.find_by(account_id: account.account_id),
      do: Entity.Controller.remove_entity(entity)

    with {:ok, entity} <- Entity.Controller.find_by(account_id: puuid),
      do: Entity.Controller.remove_entity(entity)

    payload = %{
