Fixe the duplicate entry SQL errors in unit tests

Change-Id: I37ec742b4605e80653a247853fe23930d0d6a31d
Merge "Fixe the duplicate entry SQL errors in unit tests"