I have to write the following unit test cases in testng:
saveProductTest which would return productId if product details are saved successfully in DB.
Each unit test should be independent of other tests so you more easily can see what fails. You can have a helper method saving the product and returning the id and call this from both tests.