djangid / rest-assured

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

RequestSpecification should use specified default port #73

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When creating a new RequestSpecBuilder then port is set to 8080 (DEFAULT_PORT) 
it it's not defined explicitly (using setPort). What should happen is that it 
should read from the RestAssured.port value instead if it has been changed. 

E.g. 
beforeClass: RestAssured.port = 8081

in test: given().spec(someSpec()). .. 

someSpec() should default to port 8081 and not 8080 (which overrides the before 
class port)

Original issue reported on code.google.com by johan.ha...@gmail.com on 9 Jun 2011 at 8:47

GoogleCodeExporter commented 8 years ago
The reason why this happens is that it was defined in a static method. I.e. A 
extended B where A had a static before method (MA) which is initialized before 
the static before method in B (MB). The MA defined the spec and MB defined the 
RestAssured.port. Thus when the spec was created the port really was 8080.

Original comment by johan.ha...@gmail.com on 23 Jun 2011 at 8:58