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));
}
Aggregations