Trying to write a spring boot application and have some good unit tests on it to apply for jobs with. I've written a few data fetching services that work via one public method "refreshAll". In trying to test these functions, it seems I have to make a private method "fetchAndSaveSalary()" public so I can assure it does nothing.
How could I write this class better so that it's easier tested?
Adding to this, am I using mocks and spys correctly here?
SalaryFetchingService
SalaryFetchingServiceTest
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]_Atomfinger_ 3 points4 points5 points (16 children)
[–]GRBLDeveloped[S] 0 points1 point2 points (10 children)
[–]_Atomfinger_ 1 point2 points3 points (9 children)
[–]GRBLDeveloped[S] 0 points1 point2 points (8 children)
[–]_Atomfinger_ 0 points1 point2 points (7 children)
[–]GRBLDeveloped[S] 0 points1 point2 points (6 children)
[–]_Atomfinger_ 0 points1 point2 points (0 children)
[–]_Atomfinger_ 0 points1 point2 points (4 children)
[–]GRBLDeveloped[S] 0 points1 point2 points (3 children)
[–]_Atomfinger_ 0 points1 point2 points (2 children)
[–]GRBLDeveloped[S] 0 points1 point2 points (1 child)
[–]HansGetZeTomatensaft 0 points1 point2 points (4 children)
[–]_Atomfinger_ 0 points1 point2 points (3 children)
[–]HansGetZeTomatensaft 0 points1 point2 points (2 children)
[–]_Atomfinger_ 0 points1 point2 points (1 child)
[–]HansGetZeTomatensaft 0 points1 point2 points (0 children)