I would think that if the API is yours, then injecting an authentication component that can be packaged in unit test is a suitable design. If the API is not yours, then in your unit tests you only need to check how you process the API response. The API itself can be ridiculed.
source
share