Search in sources :

Example 41 with EzyUser

use of com.tvd12.ezyfoxserver.client.entity.EzyUser in project ezyfox-server by youngmonkeys.

the class EzyZoneUserManagerImplTest method unmapSessionUserWithMaxIdleTimeGreaterThanZero.

@Test
public void unmapSessionUserWithMaxIdleTimeGreaterThanZero() {
    // given
    EzyZoneUserManagerImpl sut = newZoneUserManager();
    EzySession session = mock(EzySession.class);
    EzyUser user = mock(EzyUser.class);
    when(user.getMaxIdleTime()).thenReturn(1000L);
    Map<EzySession, EzyUser> usersBySession = FieldUtil.getFieldValue(sut, "usersBySession");
    usersBySession.put(session, user);
    // when
    sut.unmapSessionUser(session, mock(EzyConstant.class));
    // then
    Asserts.assertNull(sut.getUser(session));
}
Also used : EzyUser(com.tvd12.ezyfoxserver.entity.EzyUser) EzyZoneUserManagerImpl(com.tvd12.ezyfoxserver.wrapper.impl.EzyZoneUserManagerImpl) EzyConstant(com.tvd12.ezyfox.constant.EzyConstant) EzySession(com.tvd12.ezyfoxserver.entity.EzySession) Test(org.testng.annotations.Test)

Aggregations

EzyUser (com.tvd12.ezyfoxserver.entity.EzyUser)26 Test (org.testng.annotations.Test)16 EzySession (com.tvd12.ezyfoxserver.entity.EzySession)13 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)12 GreetResponse (com.tvd12.ezyfoxserver.support.test.data.GreetResponse)8 EzyDoHandle (com.tvd12.ezyfox.core.annotation.EzyDoHandle)7 EzyApplication (com.tvd12.ezyfoxserver.EzyApplication)6 EzyAppContext (com.tvd12.ezyfoxserver.context.EzyAppContext)6 EzySimpleServer (com.tvd12.ezyfoxserver.EzySimpleServer)5 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)5 EzyLoginProcessor (com.tvd12.ezyfoxserver.controller.EzyLoginProcessor)5 EzyResponse (com.tvd12.ezyfoxserver.response.EzyResponse)5 EzyZoneUserManager (com.tvd12.ezyfoxserver.wrapper.EzyZoneUserManager)5 EzySimpleZone (com.tvd12.ezyfoxserver.EzySimpleZone)4 EzySessionDelegate (com.tvd12.ezyfoxserver.delegate.EzySessionDelegate)4 EzyAbstractSession (com.tvd12.ezyfoxserver.entity.EzyAbstractSession)4 EzyUserLoginEvent (com.tvd12.ezyfoxserver.event.EzyUserLoginEvent)4 EzyAppUserManager (com.tvd12.ezyfoxserver.wrapper.EzyAppUserManager)4 EzyConstant (com.tvd12.ezyfox.constant.EzyConstant)3 EzyArray (com.tvd12.ezyfox.entity.EzyArray)3