Testicular cancer is manifested with a hard lump in
the testis with pain. But
in your case as you mentioned there is no swelling, then
the chances of cancers are very less.
But if you visit a urologist, at first, physical examination of testicles for any swelling will be seen, then ultrasound and scan if required can be done, to rule out all the possibilities. As your discomfort and pain have subsided with antinflammatories, I don’t think there is a need to worry.