Given:

Activation in which the AlarmManager runs.

AlarmManager starts once every n minutes of Service.

Service using Retrofit 2 & SimpleXmlConverter downloads the object from the server and sends it to the method for parsing.

The method parsit the object and, depending on what has come, it launches activations and sends the text that needs to be shown in the alert.

Question:

How and with the help of what to cover the work of this service with tests?

    1 answer 1

    Roughly speaking, you need to check whether methods are invoked. That is, you say that the download is over and the parsing method has to be called, and the test responds to this method or not. And so on. Here is a good example of how to implement it [ https://codelabs.developers.google.com/codelabs/android-testing/index.html?index=..%2F..%2Findex#5 ]