Adds test for UniqueRecordViolationException in repository.