We need to improve test coverage in our repo. This issue will target only to improve test coverage for [MLHttpClientFactory.java class](https://github.com/opensearch-project/ml-commons/blob/main/ml-algorithms/src/main/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactory.java) From this url we can see where test coverage is missing for this class: https://app.codecov.io/gh/opensearch-project/ml-commons/blob/2.x/ml-algorithms%2Fsrc%2Fmain%2Fjava%2Forg%2Fopensearch%2Fml%2Fengine%2Fhttpclient%2FMLHttpClientFactory.java