use of com.tvd12.ezyfoxserver.testing.MyTestUser in project ezyfox-server by youngmonkeys.
the class EzyDisconnectUserImplTest method test3.
@Test
public void test3() {
MyTestUser user = new MyTestUser();
user.setName("dungtv");
EzySession session = newSession();
session.setToken("abc");
user.addSession(session);
}
use of com.tvd12.ezyfoxserver.testing.MyTestUser in project ezyfox-server by youngmonkeys.
the class EzyDisconnectUserImplTest method test2.
@Test
public void test2() {
MyTestUser user = new MyTestUser();
user.setName("dungtv");
EzySession session = newSession();
session.setToken("abc");
user.addSession(session);
}
use of com.tvd12.ezyfoxserver.testing.MyTestUser in project ezyfox-server by youngmonkeys.
the class EzyRequestAppControllerTest method testHasNotAccessed.
@Test
public void testHasNotAccessed() {
EzyArray data = EzyEntityArrays.newArray(1, EzyEntityArrays.newArray());
EzyRequestAppController controller = new EzyRequestAppController();
MyTestUser user = new MyTestUser();
user.setName("dungtv1");
user.addSession(session);
EzySimpleRequestAppRequest request = new EzySimpleRequestAppRequest();
request.deserializeParams(data);
request.setUser(user);
request.setSession(session);
EzyServerContext ctx = newServerContext();
controller.handle(ctx, request);
}
use of com.tvd12.ezyfoxserver.testing.MyTestUser in project ezyfox-server by youngmonkeys.
the class EzyRequestAppControllerTest method newServerContext.
@Override
protected EzyServerContext newServerContext() {
session = newSession();
session.setToken("abc");
user = new MyTestUser();
user.setName("dungtv");
user.addSession(session);
EzyAppContext appContext = mock(EzyAppContext.class);
EzySimpleApplication app = new EzySimpleApplication();
app.setSetting(new EzySimpleAppSetting());
app.setUserManager(EzyAppUserManagerImpl.builder().build());
app.getUserManager().addUser(user);
when(appContext.getApp()).thenReturn(app);
EzyServerContext serverContext = mock(EzyServerContext.class);
when(serverContext.getAppContext(1)).thenReturn(appContext);
return serverContext;
}
use of com.tvd12.ezyfoxserver.testing.MyTestUser in project ezyfox-server by youngmonkeys.
the class EzyServerUserInterceptorTest method test1.
@Test
public void test1() throws Exception {
EzyServerContext context = newServerContext();
EzyServerUserInterceptor interceptor = new EzyServerUserInterceptor();
EzySimpleRequestAppRequest request = new EzySimpleRequestAppRequest();
request.setUser(new MyTestUser());
interceptor.intercept(context, request);
}
Aggregations