Permalink
Browse files

INT-2455: Polishing according PR comments

  • Loading branch information...
1 parent 1017708 commit f85b297a04b5761105ef9dfb881a0f95992363b2 @artembilan committed Mar 13, 2013
@@ -362,7 +362,7 @@ protected Object handleRequestMessage(Message<?> requestMessage) {
Class<?> expectedResponseType = this.determineExpectedResponseType(requestMessage);
HttpEntity<?> httpRequest = this.generateHttpRequest(requestMessage, httpMethod);
- UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(uri).buildAndExpand(uriVariables);
+ UriComponents uriComponents = UriComponentsBuilder.fromUriString(uri).buildAndExpand(uriVariables);
URI realUri = this.encodeUri ? uriComponents.toUri() : new URI(uriComponents.toUriString());
ResponseEntity<?> httpResponse = this.restTemplate.exchange(realUri, httpMethod, httpRequest, expectedResponseType);
if (this.expectReply) {
@@ -704,7 +704,7 @@ public void testUriExpression() {
HttpRequestExecutingMessageHandler handler = new HttpRequestExecutingMessageHandler(
new SpelExpressionParser().parseExpression("headers['foo']"),
restTemplate);
- String theURL = "http://bar/baz";
+ String theURL = "http://bar/baz?foo#bar";
Message<?> message = MessageBuilder.withPayload("").setHeader("foo", theURL).build();
try {
handler.handleRequestMessage(message);
@@ -720,12 +720,12 @@ public void testInt2455UriNotEncoded() {
new SpelExpressionParser().parseExpression("'http://my.RabbitMQ.com/api/' + payload"),
restTemplate);
handler.setEncodeUri(false);
- Message<?> message = MessageBuilder.withPayload("queues/%2f/si.test.queue").build();
+ Message<?> message = MessageBuilder.withPayload("queues/%2f/si.test.queue?foo#bar").build();
try {
handler.handleRequestMessage(message);
}
catch (Exception e) {}
- assertEquals("http://my.RabbitMQ.com/api/queues/%2f/si.test.queue", restTemplate.actualUrl.get());
+ assertEquals("http://my.RabbitMQ.com/api/queues/%2f/si.test.queue?foo#bar", restTemplate.actualUrl.get());
}
@Test

0 comments on commit f85b297

Please sign in to comment.