Hi,
I have an issue in mocking my rest web service's, one of the private methods.
So the flow, goes something like this,
JobController --> JobService --> createJob()
So here, in createJob() of my JobService, I will do another rest call to create a job, because job creation is hosted by someother team and I want to use the API exposed by them.
Before making a call to the API, I will create my payload, by calling prepareJobEntity(), which is a private method.
So, in my
test case, this is the way I am trying to mock.
My TestDataProvider looks something like this.
The issue I am facing is,
Argument(s) are different! Wanted:
schedulerManager.create(
com.scheduler.client.entity.Job@4a1a412e
);
-> at com.JobControllerTest.testCreateJob_whenJobDoesNotExist(JobControllerTest.java:90)
Actual invocation has different arguments:
schedulerManager.create(
com.entity.Job@c568f91
);
-> at com.JobService.createProcessingJob(JobService.java:61)
I understand both the job instances are different, and that is the reason I am getting this issue. But, kind of confused on how to solve this. Can anyone please throw some light on this?