@Test public void shouldRetriveFlightTicketNumberFromAirlineService() throws MalformedURLException { final String EXPECTED_FLIGHT_TICKET_NUMBER_BEGINNING = "33"; URL endpointURL = new URL(AirlineStarter.SERVICE_ADDRESS); FlightTicketNumberRetriever retriever = new FlightTicketNumberRetriever(endpointURL); String flightTicketNumber = retriever.getFlightTicketNumber(); assertTrue(flightTicketNumber.startsWith(EXPECTED_FLIGHT_TICKET_NUMBER_BEGINNING)); }
public String getFlightTicketNumber() { if (this.endpoint == null) { throw new IllegalStateException("Null endpoint"); } try { SOAPMessage response = invokeService(); String flightTicketNumber = parseResponse(response); return flightTicketNumber; } catch (Exception e) { throw new IllegalStateException("Something went wrong!", e); } }
FlightTicketNumberRetriever { public String getFlightTicketNumber() { if (this.endpoint == null) { throw new IllegalStateException("Null endpoint"); } try { SOAPMessage response = invokeService(); String flightTicketNumber = parseResponse(response); return flightTicketNumber; } catch (Exception e) { throw new IllegalStateException("Something went wrong!", e); } } }
FlightTicketNumberRetriever { public String getFlightTicketNumber() { if (this.endpoint == null) { throw new IllegalStateException("Null endpoint"); } try { SOAPMessage response = invokeService(); String flightTicketNumber = parseResponse(response); return flightTicketNumber; } catch (Exception e) { throw new IllegalStateException("Something went wrong!", e); } } FlightTicketNumberRetriever(URL endpoint); }
FlightTicketNumberRetriever { public String getFlightTicketNumber() { if (this.endpoint == null) { throw new IllegalStateException("Null endpoint"); } try { SOAPMessage response = invokeService(); String flightTicketNumber = parseResponse(response); return flightTicketNumber; } catch (Exception e) { throw new IllegalStateException("Something went wrong!", e); } } FlightTicketNumberRetriever(URL endpoint); String getFlightTicketNumber(); }
FlightTicketNumberRetriever { public String getFlightTicketNumber() { if (this.endpoint == null) { throw new IllegalStateException("Null endpoint"); } try { SOAPMessage response = invokeService(); String flightTicketNumber = parseResponse(response); return flightTicketNumber; } catch (Exception e) { throw new IllegalStateException("Something went wrong!", e); } } FlightTicketNumberRetriever(URL endpoint); String getFlightTicketNumber();  }