restTemplate cannot be resolved to a variable

While calling the getPortfolioManager function in mainCalculateReturnsAfterRefactor function the error is shown and if I declare restTemplate as a variable it then shows that it has not been initialized, any help and any hints if I am doing the right thing?

At the top after you define a class you might have not written a constructor which is initializing the variable restTemplate. Write that and your issue might be resolved. Let me know if the reply was helpful or not.

Thank you sir, yes exactly, this was the thing I was missing.