vasanth
I'm new here

Mockup for ScheduleContext

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

0 Kudos
3 Replies
broszeit
I'm new here

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

0 Kudos
Peter_Jodeleit
Crownpeak employee

Try this:

ScheduleContext mock = Mockito.mock(ScheduleContext.class, Mockito.RETURN_DEEP_STUBS);

Peter
0 Kudos

Thank you for code snippet. I am new to Mockito framework so let me try that and let you know.

0 Kudos