use of com.tvd12.ezyfoxserver.creator.EzySessionCreator in project ezyfox-server by youngmonkeys.
the class EzyHandlerGroupBuilderFactoryImplTest method buildWithSessionCreatorNotNull.
@Test
public void buildWithSessionCreatorNotNull() {
// given
EzySessionCreator sessionCreator = mock(EzySessionCreator.class);
EzyHandlerGroupBuilderFactoryImpl.Builder builder = EzyHandlerGroupBuilderFactoryImpl.builder().sessionCreator(sessionCreator);
// when
EzyHandlerGroupBuilderFactory factor = builder.build();
// then
Asserts.assertNotNull(factor);
}
use of com.tvd12.ezyfoxserver.creator.EzySessionCreator in project ezyfox-server by youngmonkeys.
the class EzySimpleSessionCreatorTest method test.
@SuppressWarnings("rawtypes")
@Test
public void test() {
EzySessionManager sessionManager = mock(EzySessionManager.class);
EzySimpleSessionManagementSetting sessionSetting = new EzySimpleSessionManagementSetting();
EzySessionCreator creator = EzySimpleSessionCreator.builder().sessionManager(sessionManager).sessionSetting(sessionSetting).build();
EzyAbstractSession session = spy(EzyAbstractSession.class);
when(sessionManager.provideSession(any())).thenReturn(session);
assert creator.create(mock(EzyChannel.class)) == session;
}
Aggregations