I have this class called restTemplate. It is a RestTemplate object from the Spring Framework. I am trying to reset it in the beginning of a setup method for my Mockito test but I get the exception:
org.mockito.exceptions.misusing.NotAMockException: Argument should be a mock, but is null!
So what am I doing wrong? I have the correct packages listed under
<context:component-scan base-package = "..."/>
It is autowired into my test class and is listed in my applicationContext-test.xml file. What should I be looking at first?
Edit:
<bean id="restTemplate" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.web.client.RestTemplate" />
</bean>