Long story short, I need to test code executed in the "doInBackground" method of AsyncTask.
This in Android Studio with PowerMockito / Mockito / Robolectric / JUnit4.
I am aware testing written code is far from ideal,
but I have no word in this and I can't change the original code.
This is the case :
public void methodToTest(){
new AsyncTask<Integer, Void, Boolean>() {
@Override
protected Boolean doInBackground(Integer... integers) {
//How to test code written over here ?
return false;
}
}
}
Is there a way to solve this ? Any suggestions are very much appreciated