@teddy It sounds like you're working on some old code. You should move the service creation code to outside the view model, and test it independently.
Side note, I often try to avoid making my classes depending directly on the SDK component such as Context, or Application, it makes things very hard to test. I often move such dependency into a single-purpose class to "quarantine" the dependency on SDK components, and make my ViewModel depend on that class instead. That way, the dependency on SDK component is isolated, and can be tested more easily, while the ViewModel can be tested with a mock implementation/object of such quarantining class.