<How to test using mockk library kotlin for Handle...
# stackoverflow
r
How to test using mockk library kotlin for Handler class? Code : public class MyApplication extends Application { private Handler handler; private Context context; @Override public void onCreate() { super.onCreate(); context = getApplicationContext(); handler = new Handler(context.getMainLooper()) { @Override public void handleMessage(Message msg) { switch (msg.what) { case 1: Handle message case 1 break; case 2: Handle message case 2 break; Add more cases as needed default: Handle other cases or provide a default behavior break; } } }; Sending...