Campoie / rest-assured

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

Change so that statius code/status line are validated before response #131

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Regardless of the order of my expects statements, it seems that body()
json assertions are processed before any status code our content type
checking. we found that our http calls were returning 500 among with
text/html but restassured didn't catch this, just failed on json
parsing.

Original issue reported on code.google.com by johan.ha...@gmail.com on 26 Oct 2011 at 10:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I've made a simple test and I cannot seem to reproduce this. 

        expect().
                statusCode(200).
                body("doesnt.exist", equalTo("something")).
        when().
                get("/statusCode500");

"/statusCode500" returns (you guessed it) status code 500 and content-type 
"text/plain". The test fails because status code 200 doesn't match the actual 
status code. 

Could you give an example of a test that fails?

Original comment by johan.ha...@gmail.com on 3 Nov 2011 at 7:52

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 17 Dec 2011 at 2:42