Skip to content

Commit

Permalink
Updated URL for WeatherTest
Browse files Browse the repository at this point in the history
  • Loading branch information
mbogoevici committed Sep 10, 2012
1 parent 1551caf commit f616592
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit f616592

Please sign in to comment.