I am writing Junit test case for a method which does a job in background thread. To test the flow, I am planning to write a ExecutorService that I can use in my testcase. The ExecutorService should run the job in main thread. What I mean is that ExecutorService implementation should use the main thread to execute any task submitted to it. It must not create any worker thread. Anyone has sample code for that?
Kovychi
Level 0
How to create Java ExecutorService object that runs task in main thread?
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
seo working
27 June, 07:18
Earning the EC-Council Certified Ethical Hacker (CEH) certification by passing the https://www.examsleader.com/312-50-exam.html is a landmark achievement for cybersecurity professionals.
0
Kovychi
19 June 2022, 08:22
Found the answer here.
0