Search the FirstSpirit Knowledge Base
Hello All,
I have manual Schedule Task for my project in the server. But I plan to create a Testng test case for that. Is it possible to create to mockup object for the ScheduleContext ??. If so please let me know the steps to follow.
Happy Holidays !!!!!!!!!!!!!
Thank You,
Vasandharaj M
Hello,
yes, of course it is possible to mock the ScheduleContext.
You can mock it like any other Java object.
The amount of work you have to do when you are mocking the ScheduleContext depends on the methods (and the number of methods) you want to call from it.
Regards
Rouven
Try this:
ScheduleContext mock = Mockito.mock(ScheduleContext.class, Mockito.RETURN_DEEP_STUBS);
Thank you for code snippet. I am new to Mockito framework so let me try that and let you know.