79531109

Date: 2025-03-24 12:50:26
Score: 0.5
Natty:
Report link

I have one suggessions bewfore writing my answer

"Use Constructor injections whenever possible to avoid whitebxoing or using reflection in Unit tests"

Now your answer:

as the response is build using restTemplate.exchange method, hence you must be mocking restTemplate Object and mock the exchange method to return the expected response

Reasons:
  • No code block (0.5):
Posted by: Kumar Gaurav