We don’t know of anyone getting HIV or STIs from a situation like this one. HIV and STIs are passed through unprotected sex or direct blood-to-blood contact. You are always welcome to get STI or HIV tests if it will reassure you, but I do not think they are needed in this situation.
It sounds like you are quite worried about getting an STI and have been thinking a lot about this. Some people find that they can’t stop worrying about an infection, even if they are not really at very much risk. If this happens to you, it might help to use strategies like deep breathing, or to talk to a counsellor or someone you trust about these thoughts.
Hope this helps,