sahaya / rest-assured

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

RequestSpecification overrides session config #234

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

        final RequestSpecification requestSpecification = new RequestSpecBuilder().addHeader("Accept", "application/json").addHeader("Content-Type", "application/json").build();

        RestAssured.requestSpecification = requestSpecification;
        RestAssured.sessionId = "demo";

result: Requests will not have the "JSESSIONID" set.
ugly workaround: I have to add a custom session cookie to the request 
specification like

final com.jayway.restassured.response.Cookie sessionCookie = new 
com.jayway.restassured.response.Cookie.Builder("JSESSIONID", "demo").build();
                RestAssured.requestSpecification.cookie(sessionCookie);

Original issue reported on code.google.com by everf...@gmail.com on 11 May 2013 at 6:08

GoogleCodeExporter commented 9 years ago
That's because request specifications overrides static configuration. Perhaps 
that shouldn't be the case when configuring a request specification statically. 
Please help out!

Original comment by johan.ha...@gmail.com on 14 May 2013 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 22 Jan 2014 at 9:56