I am testing for preemptive authorization using BDD for API automation using Rest assured. Is this the correct syntax?
given().get("url").when().auth("username","pwd").then().assertthat().statuscode(200)
Can I write get()
after given()
or should it be in when()
?
Try this, it works for me when i use this with Testng.
httpreq.auth().preemptive().basic("ToolsQA", "TestPassword");
reponse = httpreq.request(Method.GET,"/authentication/CheckForAuthentication");
Thanks for Asking,