use of io.restassured.authentication.FormAuthConfig in project rest-assured by rest-assured.
the class AuthenticationITest method sessionFilterRecordsAndProvidesTheSessionIdWhenSessionNameIsNotDefault.
@Test
public void sessionFilterRecordsAndProvidesTheSessionIdWhenSessionNameIsNotDefault() throws Exception {
final SessionFilter sessionFilter = new SessionFilter();
given().config(RestAssuredConfig.newConfig().sessionConfig(sessionConfig().sessionIdName("phpsessionid"))).auth().form("John", "Doe", new FormAuthConfig("/j_spring_security_check_phpsessionid", "j_username", "j_password")).filter(sessionFilter).expect().statusCode(200).body(equalTo("OK")).when().get("/formAuth");
assertThat(sessionFilter.getSessionId(), equalTo("1234"));
}
Aggregations