test cases for upsert