Testicular pain can be due to injury, infection (Epididymitis or Orchitis) or inflammation, testicular torsion -- most common in young men between 10 and 20 years old, excessive bicycle riding, varicocele, hernia or kidney or ureteric stones. Considering your symptoms epididymitis or orchitis need to be ruled out. Get an evaluation done from a urologist to confirm the diagnosis.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.