Permalink
Browse files

Updated URL for WeatherTest

  • Loading branch information...
1 parent 1551caf commit f616592266dd8ed38790713534b4398effa7d882 @mbogoevici mbogoevici committed Sep 10, 2012
View
8 siia-examples-parent/flight-booking/integration/src/main/resources/weather-endpoint.xml
@@ -10,7 +10,13 @@
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
- <http:outbound-gateway url="http://www.google.com/ig/api?weather={location}"
+ <!--
+ NOTE: In this example we use a different URL than in the book. The original service was
+ discontinued since the book went to print, therefore this running example uses an
+ alternative URL. All the other aspects of the example are identical, and the example
+ in the book remains, in principle, correct
+ -->
+ <http:outbound-gateway url="http://weather.yahooapis.com/forecastrss?w={location}"
request-channel="weatherRequests"
http-method="GET" >
<http:uri-variable name="location" expression="payload" />
View
7 ...parent/flight-booking/integration/src/test/java/siia/booking/integration/WeatherTest.java
@@ -25,9 +25,10 @@ public void setChannel(MessageChannel messageChannel){
this.channelTemplate = new MessagingTemplate(messageChannel);
}
- @Test @Ignore
- public void testCambridge(){
- Message message = MessageBuilder.withPayload("cambridge,uk").build();
+ @Test
+ public void testToronto(){
+ // 4118 is the Yahoo! WOEID (Where On Earth ID) for Toronto, Canada
+ Message message = MessageBuilder.withPayload("4118").build();
Message response = channelTemplate.sendAndReceive(message);
System.out.println(response.getPayload());
}

0 comments on commit f616592

Please sign in to comment.