Testing an elixir function using Mock

Thanks for suggesting the approach. This nicely tests the scenario of duplicate UPIs.