use of io.restassured.filter.session.SessionFilter in project rest-assured by rest-assured.
the class AuthenticationITest method reusingSameSessionFilterInDifferentRequestsAppliesTheSessionIdToTheNewRequest.
@Test
public void reusingSameSessionFilterInDifferentRequestsAppliesTheSessionIdToTheNewRequest() throws Exception {
final SessionFilter sessionFilter = new SessionFilter();
given().auth().form("John", "Doe").filter(sessionFilter).expect().statusCode(200).body(equalTo("OK")).when().get("/formAuth");
given().filter(sessionFilter).expect().statusCode(200).body(equalTo("OK")).when().get("/formAuth");
}
use of io.restassured.filter.session.SessionFilter in project ddf by codice.
the class JettySessionManagementTest method sessionsAreReusable.
@Test
public void sessionsAreReusable() {
SessionFilter sessionFilter = new SessionFilter();
String sessionId = RestAssured.given().filter(sessionFilter).get(String.format("http://localhost:%s/context1/newSession", port)).then().statusCode(is(SC_OK)).extract().sessionId();
assertThat(sessionId, is(not(nullValue())));
RestAssured.given().filter(sessionFilter).get(String.format("http://localhost:%s/context1/existingSession", port)).then().statusCode(is(SC_OK));
}
use of io.restassured.filter.session.SessionFilter in project dhis2-core by dhis2.
the class ConfigurationExtension method defaultRequestSpecification.
private RequestSpecification defaultRequestSpecification() {
RequestSpecBuilder requestSpecification = new RequestSpecBuilder();
requestSpecification.addFilter(new CookieFilter());
requestSpecification.addFilter(new SessionFilter());
requestSpecification.addFilter(new AuthFilter());
requestSpecification.setContentType(ContentType.JSON);
return requestSpecification.build();
}
Aggregations