No. In most cases, you decide whether to get tested for HIV. If you decide not to get tested, it is against the law for a health care provider to test you without your permission.
If you are pregnant, you will be tested for HIV unless you say you do not want to be tested. Before you are tested, a counselor will talk with you privately about any questions or concerns you may have. You will also be able to talk to the counselor after you get the results from your test. The counselor will never tell anyone about your conversations.