### Question:
GetFlights extends WebServiceGatewaySupport { public GetFlights(WebServiceMessageFactory messageFactory) { super(messageFactory); } GetFlights(WebServiceMessageFactory messageFactory); void getFlights();  }### Answer:
@Test public void getFlights() { Source getFlightsRequest = new StringSource("<GetFlightsRequest xmlns='" + MESSAGES_NS + "'>" + "<from>AMS</from>" + "<to>VCE</to>" + "<departureDate>2006-01-31</departureDate>" + "</GetFlightsRequest>"); String flightInfo = "<t:number>KL1653</t:number>" + "<t:departureTime>2006-01-31T10:05:00.000+01:00</t:departureTime>" + "<t:from><t:code>AMS</t:code><t:name>Schiphol Airport</t:name><t:city>Amsterdam</t:city></t:from>" + "<t:arrivalTime>2006-01-31T12:25:00.000+01:00</t:arrivalTime>" + "<t:to><t:code>VCE</t:code><t:name>Marco Polo Airport</t:name><t:city>Venice</t:city></t:to>" + "<t:serviceClass>economy</t:serviceClass>"; Source getFlightsResponse = new StringSource("<m:GetFlightsResponse xmlns:m='" + MESSAGES_NS + "' xmlns:t='" + TYPES_NS + "'>" + "<m:flight>" + flightInfo + "</m:flight>" + "</m:GetFlightsResponse>"); mockServer.expect(payload(getFlightsRequest)).andRespond(withPayload(getFlightsResponse)); Source bookFlightResponse = new StringSource("<m:BookFlightResponse xmlns:m='" + MESSAGES_NS + "' xmlns:t='" + TYPES_NS + "'>" + "<t:id>4</t:id>" + "<t:issueDate>2010-07-28</t:issueDate>" + "<t:passengers><t:passenger><t:first>John</t:first><t:last>Doe</t:last></t:passenger></t:passengers>" + "<t:flight>" + flightInfo + "</t:flight>" + "</m:BookFlightResponse>"); Map<String, String> namespaces = Collections.singletonMap("m", MESSAGES_NS); mockServer.expect(xpath("/m:BookFlightRequest/m:flightNumber", namespaces).exists()) .andExpect(xpath("/m:BookFlightRequest/m:departureTime", namespaces).exists()) .andExpect(xpath("/m:BookFlightRequest/m:passengers", namespaces).exists()) .andRespond(withPayload(bookFlightResponse)); getFlights.getFlights(); mockServer.verify(); }