use of org.springframework.web.server.WebSession in project spring-session by spring-projects.
the class SpringSessionWebSessionStoreTests method createSessionWhenGetAttributesAndContainsKeyAndNotFoundThenFalse.
@Test
public void createSessionWhenGetAttributesAndContainsKeyAndNotFoundThenFalse() {
WebSession createdWebSession = this.webSessionStore.createWebSession().block();
Map<String, Object> attributes = createdWebSession.getAttributes();
assertThat(attributes.containsKey("a")).isFalse();
}
use of org.springframework.web.server.WebSession in project spring-session by spring-projects.
the class SpringSessionWebSessionStoreTests method createSessionWhenGetAttributesAndPutThenDelegatesToCreateSession.
@Test
public void createSessionWhenGetAttributesAndPutThenDelegatesToCreateSession() {
WebSession createdWebSession = this.webSessionStore.createWebSession().block();
Map<String, Object> attributes = createdWebSession.getAttributes();
attributes.put("a", "b");
verify(this.createSession).setAttribute("a", "b");
}
use of org.springframework.web.server.WebSession in project spring-session by spring-projects.
the class SpringSessionWebSessionStoreTests method createSessionWhenGetAttributesAndPutAllThenDelegatesToCreateSession.
@Test
public void createSessionWhenGetAttributesAndPutAllThenDelegatesToCreateSession() {
WebSession createdWebSession = this.webSessionStore.createWebSession().block();
Map<String, Object> attributes = createdWebSession.getAttributes();
attributes.putAll(Collections.singletonMap("a", "b"));
verify(this.createSession).setAttribute("a", "b");
}
use of org.springframework.web.server.WebSession in project spring-session by spring-projects.
the class SpringSessionWebSessionStoreTests method createSessionWhenGetAttributesAndIsEmptyThenDelegatesToCreateSession.
@Test
public void createSessionWhenGetAttributesAndIsEmptyThenDelegatesToCreateSession() {
WebSession createdWebSession = this.webSessionStore.createWebSession().block();
Map<String, Object> attributes = createdWebSession.getAttributes();
assertThat(attributes.isEmpty()).isTrue();
given(this.createSession.getAttributeNames()).willReturn(Collections.singleton("a"));
assertThat(attributes.isEmpty()).isFalse();
}
use of org.springframework.web.server.WebSession in project spring-session by spring-projects.
the class SpringSessionWebSessionStoreTests method createSessionWhenGetAttributesAndRemoveThenDelegatesToCreateSession.
@Test
public void createSessionWhenGetAttributesAndRemoveThenDelegatesToCreateSession() {
WebSession createdWebSession = this.webSessionStore.createWebSession().block();
Map<String, Object> attributes = createdWebSession.getAttributes();
attributes.remove("a");
verify(this.createSession).removeAttribute("a");
}
Aggregations