@Test
public void testEndpointUriResolver() {
WebServiceClient client = new WebServiceClient();
client.getEndpointConfiguration().setWebServiceTemplate(webServiceTemplate);
EndpointUriResolver endpointUriResolver = EasyMock.createMock(EndpointUriResolver.class);
client.getEndpointConfiguration().setEndpointResolver(endpointUriResolver);
Message requestMessage = new SoapMessage("<TestRequest><Message>Hello World!</Message></TestRequest>");
reset(webServiceTemplate, endpointUriResolver);
webServiceTemplate.setDefaultUri("http://localhost:8080/request");
expectLastCall().once();
webServiceTemplate.setFaultMessageResolver(anyObject(FaultMessageResolver.class));
expectLastCall().once();
expect(endpointUriResolver.resolveEndpointUri(requestMessage, "http://localhost:8080/request")).andReturn("http://localhost:8081/new").once();
expect(webServiceTemplate.sendAndReceive(eq("http://localhost:8081/new"),
(WebServiceMessageCallback)anyObject(), (WebServiceMessageCallback)anyObject())).andReturn(true).once();
replay(webServiceTemplate, endpointUriResolver);