djangid / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

IllegalStateException when getting a 401 #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Try to get the return of a HTTP 401 status code

What is the expected output? What do you see instead?
When we try this:
String returnStr = with().parameters("name", "tester", "paswoord", 
"paswoord").post("/rest/authentication/validation/").asString();

It gives the following exception: java.lang.IllegalStateException: You cannot 
use REST Assured expectations and return the response at the same time.

As we can see, we do not use an expectation but rather want the response.

What version of the product are you using? On what operating system?
1.1

Please provide any additional information below.
We have also tried: 
String returnStr = with().parameters("name", "tester", "paswoord", 
"paswoord").post("/rest/authentication/validation/").andReturn().body().asString
();

Original issue reported on code.google.com by sem...@gmail.com on 2 Mar 2011 at 2:56

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I've confirmed the bug and I'll try to fix it asap. Thanks for reporting.

Original comment by johan.ha...@gmail.com on 3 Mar 2011 at 7:53

GoogleCodeExporter commented 8 years ago
It has now been fixed a committed to trunk. Please verify it if you like. I'll 
release a new version in a couple of days.

Original comment by johan.ha...@gmail.com on 3 Mar 2011 at 8:28