I am new to JUnit and Mockito. Can someone please guide how to mock the below rest template? My current mocking shows an error: Unfinished Stubbing.
Service
class MyService { void func(){ (SimpleClientHttpRequestFactory).restTemplate.getRequestFactory()).setConnectTimeout(t1); } } Mockito
Class MyTest { @Inject MyService service; @Mock RestTemplate template; @Test void testit(){ doNothing().when((SimpleClientHttpRequestFactory) .restTemplate.getRequestFactory())).setTimeout(anyInt(); } }