I'm testing this scenario and it works fine on a REST Client. But getting a 401 Error while using REST Assured. This is a legacy application I'm trying to automate.The issue seem like I'm able not able to use the same session for all the calls with RESTAssured. Any help to approach this issue would be appreciated.Scenario: Create Object Test scenarioGiven user user1 and password password1When create object loan application with applicant_name ken and amt 10000Then verify loan application is created with applicant_name ken and amt 10000Using REST Client (Google or Firefox Plugin) - Everything works fine1. Authenticate Step (POST): URI : /LoanApp/k_spring_security_check Body : k_username=ken&k_password=xxxx&spring-security-redirect=#2. Create Object Step (POST) : URI : /LoanApp/application/loanapplications?type=_loanapplication Header : Content-Type application/json, Request Body: {"\applicant_name"\:"\ken"\,"application_amt\":\"10000"} Response : {"id":"1234xxxx"}3. Verify Object Step (GET): URI : /LoanApp/application/loanapplications/1234xxxx Response : {"\applicant_name"\:"\ken"\,"application_amt\":\"10000"}Using RESTAssured - Authentication works , rest of them fails1. Authenticate Step (POST Works Fine) :given().body("j_username=ken&j_password=xxxx&spring-security-redirect=%2F%23").expect().statusCode(200).when().post("/LoanApp/k_spring_security_check")2. Create Object Step (POST fails with 401 unauhorized) : given().contentType("application/json").body(JSONpayload).expect().statusCode(201).post("/application/loanapplications?type=loanapplication");3. Verify Object Step (GET fails with 401 unauthorized): given().get("/application/light_loanapplications/"+loanID);--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.