Closed GoogleCodeExporter closed 9 years ago
Looks like a bug! As a work-around try setting the port statically
(RestAssured.port = 8002) or perhaps try to use given().port(8002) and see if
that works.
Original comment by johan.ha...@gmail.com
on 20 Dec 2013 at 8:41
I cannot reproduce this. Could you please provide some more info?
Original comment by johan.ha...@gmail.com
on 20 Dec 2013 at 8:51
Closing because no response from user
Original comment by johan.ha...@gmail.com
on 28 Dec 2013 at 3:08
Sorry for the delay. I finally got the time to work through it. My mistake was
attempting to do this:
private static final String BASE = "http://localhost:8002/manage/v2/packages";
...
req.head("{BASE}/{pkgname}", BASE, packageName);
But it's pretty clear that applyPathParmasAndEncodePath() doesn't support
having the base URI parts in parameters that way. Ultimately
getTargetPath(path) returns "http://localhost:8080"
Original comment by normanwalsh
on 9 Jan 2014 at 9:49
Thanks, I'll look into it when I get the opportunity.
Original comment by johan.ha...@gmail.com
on 10 Jan 2014 at 7:12
I thought about this some more and I actually don't think I ought to implement
this because it leads to inconsistencies. Perhaps you have an API that expects
a call to http://localhost:8080 with a path param to a URI. For example
(JAX-RS):
@GET
@Path("/{uri}/{pkgname}");
public String x(..) {}
Now REST Assured should be able to send the following:
get("{uri}/{pkgname}", "http://localhost:8002/manage/v2/packages",
"packageName"). ..
Which means that the URI must be URL encoded as a parameter. So your example is
really a special case and I think you should just do like this:
req.head(BASE + "/{pkgname}", packageName);
or:
RestAssured.baseURI = BASE;
req.head("/{pkgname}", packageName);
Original comment by johan.ha...@gmail.com
on 18 Jan 2014 at 5:16
Sure, that's fine. I do think it's worth documenting somewhere that what I
tried won't work. Finding it by debugging the Groovy library that does the
substitution was a little, uh, tedious ;-)
Original comment by normanwalsh
on 28 Jan 2014 at 6:18
Probably a good idea :) You're very welcome to help out and submit a pull
request.
Original comment by johan.ha...@gmail.com
on 28 Jan 2014 at 7:08
Touche. I'll put it on my todo list.
Original comment by normanwalsh
on 28 Jan 2014 at 7:13
:)
Original comment by johan.ha...@gmail.com
on 28 Jan 2014 at 7:29
Issue 313 has been merged into this issue.
Original comment by johan.ha...@gmail.com
on 21 Feb 2014 at 10:07
Issue 313 has been merged into this issue.
Original comment by johan.ha...@gmail.com
on 21 Feb 2014 at 10:08
Issue 313 has been merged into this issue.
Original comment by johan.ha...@gmail.com
on 21 Feb 2014 at 10:08
Issue 313 has been merged into this issue.
Original comment by johan.ha...@gmail.com
on 21 Feb 2014 at 10:09
Original issue reported on code.google.com by
normanwalsh
on 13 Dec 2013 at 10:37