use of com.tvd12.ezyfoxserver.testing.MyTestSessionManager in project ezyfox-server by youngmonkeys.
the class EzySimpleSessionManagerTest method isUnloggedInSessionTrueTest.
@Test
public void isUnloggedInSessionTrueTest() {
// given
MyTestSessionManager manager = new MyTestSessionManager.Builder().build();
EzySession session = mock(EzySession.class);
when(session.isLoggedIn()).thenReturn(false);
when(session.isActivated()).thenReturn(true);
when(session.getMaxWaitingTime()).thenReturn(0L);
when(session.getCreationTime()).thenReturn(System.currentTimeMillis() + 1);
// when
Boolean result = MethodInvoker.create().object(manager).method("isUnloggedInSession").param(EzySession.class, session).invoke(Boolean.class);
// then
Asserts.assertTrue(result);
}
Aggregations