hmpatel / rest-assured

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

RequestSpecification.basePath is ignored during form authentication #407

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've noticed that RequestSpecification.basePath is ignored when using form 
authentication.

Consider two scenarious below:
1) working snippet:

RestAssured.basePath = "/my-app";
given()
  .auth().form(userName, password, FormAuthConfig.springSecurity())
  .when()
  .get("tested-api")

2) non working snippet:
====================
RequestSpecification mySpec= new RequestSpecBuilder()
  .setBasePath("/my-app")
  .build();
given()
  .spec(mySpec)
  .auth().form(userName, password, FormAuthConfig.springSecurity())
  .when()
  .get("tested-api")

In working snippet (1) authentication form sent to 
/my-app/j_spring_security_check
While in non-working snippet (2) authentication form sent to 
/j_spring_security_check
actual GET request does respect basePath in both cases.

Original issue reported on code.google.com by zilberk...@gmail.com on 27 May 2015 at 3:15