If you have symptoms that suggest you have some form of bacterial urethritis, your healthcare provider will take a urine sample and/or one or more swab samples from your penis or vagina. Those samples will be sent to a laboratory, which will test them to determine what infection is causing your discomfort. If your doctor doesn't test your urine for bacterial DNA, it is unlikely that he will detect a Mycoplasma infection, since it is almost impossible to grow the bacterium from swabs outside of a research laboratory (or, I can say from personal experience, inside of a research laboratory.) Your provider may also do additional tests to rule out other sexually transmitted infections, such as syphilis, or other conditions that frequently occur simultaneously with urethritis/cervicitis.
Sources:
Anagrius C et al. "Mycoplasma genitalium: prevalence, clinical significance, and transmission" Sex Transm Infect 2005; 81: 458-462
Tosh AK et al. "Mycoplasma genitalium among adolescent women and their partners." J Adolesc Health. 2007 May;40(5):412-7.

