Don’t mock it; instead pass in the random uuid as an argument; have it return something like {:error, :uuid_already_in_use} in the function generating the upi so you can try with a new one if the UUID should already be taken.
In general I think it is a good idea to pass this kind of data into functions, including timestamps, as it will make testing a lot easier.






















