If you're unsure about the legitimacy of the iPhone 7 cases you purchased on Amazon, there are a few things you can do to check.
First, make sure that the seller is an authorized Apple reseller. You can do this by checking Apple's list of authorized resellers https://www.apple.com/uk/shop/browse/resellers.
If the seller is not on this list, they may still be a legitimate reseller, but it's always best to err on the side of caution and buy from an authorized seller.
Next, check the reviews for the product. If there are no reviews, or only a few, that's usually a red flag.
If there are reviews, see what people are saying. Are they generally positive? Are there a lot of complaints about the product being fake or not as described?
If you're still unsure, you can always contact Apple support directly and ask if they are familiar with the seller/product in question https://support.apple.com/contact.
I hope this helps!