That's not how HIV is spread. In an adult, only unprotected anal/vaginal sex and sharing IV drug needles with infected users are a risk for possible infection. Since you had no risk, obviously you have no reason to get tested.
I agree. Your exposure was not a risk for HIV. HIV is spread as chima7 says through the sexual contact of unprotected vaginal or anal sex or sharing IV drug needles. Air and saliva deactivate the virus. Masturbating someone involves air. So, this is not a risk and you do not need to worry or stress. No need to test. See a doctor if you are still sick but it is unrelated to hiv.