use of com.canoo.platform.server.client.ClientSession in project dolphin-platform by canoo.
the class ClientSessionImplTest method testRemoveAttribute.
@Test
public void testRemoveAttribute() {
// given:
ClientSession dolphinSession = new HttpClientSessionImpl(new HttpSessionMock());
// when:
dolphinSession.setAttribute("test-attribute", "Hello Dolphin Session");
dolphinSession.removeAttribute("test-attribute");
// then:
Assert.assertEquals(0, dolphinSession.getAttributeNames().size());
Assert.assertNull(dolphinSession.getAttribute("test-attribute"));
}
use of com.canoo.platform.server.client.ClientSession in project dolphin-platform by canoo.
the class ClientSessionImplTest method testInvalidate.
@Test
public void testInvalidate() {
// given:
ClientSession dolphinSession = new HttpClientSessionImpl(new HttpSessionMock());
// when:
dolphinSession.setAttribute("test-attribute1", "Hello Dolphin Session");
dolphinSession.setAttribute("test-attribute2", "Yeah!");
dolphinSession.setAttribute("test-attribute3", "Dolphin Platform");
dolphinSession.invalidate();
// then:
Assert.assertEquals(0, dolphinSession.getAttributeNames().size());
Assert.assertFalse(dolphinSession.getAttributeNames().contains("test-attribute1"));
Assert.assertFalse(dolphinSession.getAttributeNames().contains("test-attribute2"));
Assert.assertFalse(dolphinSession.getAttributeNames().contains("test-attribute3"));
Assert.assertNull(dolphinSession.getAttribute("test-attribute1"));
Assert.assertNull(dolphinSession.getAttribute("test-attribute2"));
Assert.assertNull(dolphinSession.getAttribute("test-attribute3"));
}
use of com.canoo.platform.server.client.ClientSession in project dolphin-platform by canoo.
the class ClientSessionImplTest method testNullAttribute.
@Test
public void testNullAttribute() {
// given:
ClientSession dolphinSession = new HttpClientSessionImpl(new HttpSessionMock());
// then:
Assert.assertEquals(0, dolphinSession.getAttributeNames().size());
Assert.assertNull(dolphinSession.getAttribute("test-attribute"));
}
Aggregations