Female military applicants in Indonesia are subjected to virginity tests - including the discredited "two finger test" to determine if the hymen is intact - in order to recruit the "best people" to the armed forces.

Human Rights Watch is lobbying countries - including Australia - who are attending an international conference on military medicine in Bali next week, to urge Indonesian president Joko Widodo to abolish the "discriminatory and invasive testing".

Indonesian military spokesman Major-General Fuad Basya​ told Fairfax Media virginity tests were performed on female candidates as part of health tests required to enter the military.

"It is done in order to get the best people both physically and mentally," General Fuad said.