i need to write testcase for connectTimeout and SocketTimeout exception. Am using powerMock to create mock objects. Below is my code. But am getting null pointer exception for m
Acording to powermock documentation, in the section mock constructor, you should be doing something like that:
URL mockURL = PowerMockito.mock(URL.class);
expectNew(File.class, url).andReturn(mockURL);
replay(mockURL, File.class);
Also, be sure to use annotations @PrepareForTest(Sender.class)
and @RunWith(PowerMockRunner.class)