Refactoring for Mocking RestTemplate

Refactoring for Mocking RestTemplate