Here is my code:
URL url = new URL(getURL());
SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapConnFactory.createConnection();`
response=soapConnection.call(soapMsg, url);
I'm trying to create a mock for SOAPConnection
but I get an exception.
Can anyone suggest me any work-around for this?
My test is something like this:
I created a SOAPMessage
object and URL
object.
Resource classUnderTest = new Resource();
SOAPConnection mockConnection = EasyMock.createMock(SOAPConnection.class);
EasyMock.expect(mockConnection.call(soapmsg, url)).andReturn(soapMsg);
EasyMock.replay(mockConnection);
WhiteBox.setinternalState(classUnderTest, SOAPConnection.class, mockConnection);