use of org.wildfly.clustering.web.session.ImmutableSession in project wildfly by wildfly.
the class UndertowHttpSessionFactoryTestCase method getId.
@Test
public void getId() {
ImmutableSession session = mock(ImmutableSession.class);
ServletContext context = mock(ServletContext.class);
String expected = "session";
when(session.getId()).thenReturn(expected);
String result = this.factory.createHttpSession(session, context).getId();
assertSame(expected, result);
}
use of org.wildfly.clustering.web.session.ImmutableSession in project wildfly by wildfly.
the class UndertowHttpSessionFactoryTestCase method setAttribute.
@Test
public void setAttribute() {
ImmutableSession session = mock(ImmutableSession.class);
ServletContext context = mock(ServletContext.class);
this.factory.createHttpSession(session, context).setAttribute("name", "value");
verifyNoInteractions(session);
}
use of org.wildfly.clustering.web.session.ImmutableSession in project wildfly by wildfly.
the class UndertowHttpSessionFactoryTestCase method invalidate.
@Test
public void invalidate() {
ImmutableSession session = mock(ImmutableSession.class);
ServletContext context = mock(ServletContext.class);
this.factory.createHttpSession(session, context).invalidate();
verifyNoInteractions(session);
}
use of org.wildfly.clustering.web.session.ImmutableSession in project wildfly by wildfly.
the class UndertowHttpSessionFactoryTestCase method getCreationTime.
@Test
public void getCreationTime() {
ImmutableSession session = mock(ImmutableSession.class);
ServletContext context = mock(ServletContext.class);
SessionMetaData metaData = mock(SessionMetaData.class);
Instant now = Instant.now();
when(session.getMetaData()).thenReturn(metaData);
when(metaData.getCreationTime()).thenReturn(now);
long result = this.factory.createHttpSession(session, context).getCreationTime();
assertEquals(now.toEpochMilli(), result);
}
use of org.wildfly.clustering.web.session.ImmutableSession in project wildfly by wildfly.
the class UndertowHttpSessionFactoryTestCase method setMaxInactiveInterval.
@Test
public void setMaxInactiveInterval() {
ImmutableSession session = mock(ImmutableSession.class);
ServletContext context = mock(ServletContext.class);
this.factory.createHttpSession(session, context).setMaxInactiveInterval(10);
verifyNoInteractions(session);
}
Aggregations