   @not_found_id "not_found"
 
   describe "get_lead/1" do
-    @lead_id "lead_IIDHIStmFcFQZZP0BRe99V1MCoXWz2PGCm6EDmR9v2O"
+    @lead_id Closex.MockClient.get_lead_id
 
     test "when called in quick succession returns cached copy" do
       fallback = Closex.CachingClient.get_lead(@lead_id)

  end

  describe "update_opportunity/2" do
    @update_opportunity_id "update_oppo_8eB77gAdf8FMy6GsNHEy84f7uoeEWv55slvUjKQZpJt"
    test "invalidates cache when updating opportunity" do
      {:ok, result} = Closex.CachingClient.get_opportunity(@update_opportunity_id)
      assert_received {:closex_mock_client, :get_opportunity, [@update_opportunity_id, []]}
      assert result["confidence"] != 50

      {:ok, updated_opportunity} = Closex.CachingClient.update_opportunity(@update_opportunity_id, %{"confidence" => 50})
      assert_received {:closex_mock_client, :update_opportunity, [@update_opportunity_id, %{"confidence" => 50}, []]}

  end

  describe "update_lead/2" do
    @update_lead_id Closex.MockClient.get_lead_id
    test "invalidates cache when updating lead" do
      {:ok, result} = Closex.CachingClient.get_lead(@update_lead_id)
      assert result["name"] == "Wayne Enterprises (Sample Lead)"

      {:ok, updated_lead} = Closex.CachingClient.update_lead(@update_lead_id, %{"name" => "New Name"})
      assert_received {:closex_mock_client, :update_lead, [@update_lead_id, %{"name" => "New Name"}, []]}
