use of com.tvd12.ezyfoxserver.testing.MyTestUserManager in project ezyfox-server by youngmonkeys.
the class EzyUserManagerImplTest method test.
@Test
public void test() {
MyTestUserManager manager = MyTestUserManager.builder().build();
MyTestSession session = new MyTestSession();
session.setId(10);
MyTestUser user = new MyTestUser();
user.setId(1);
user.setName("dungtv");
session.setToken("123456");
user.addSession(session);
manager.addUser(session, user);
assert manager.getUser(1) == user;
assert manager.getUser("dungtv") == user;
assert manager.containsUser(1);
assert !manager.containsUser(-1);
assert manager.containsUser(session);
assert manager.containsUser(user);
manager.removeUser(user.getId());
assert manager.getUser(1) == null;
manager.addUser(session, user);
manager.removeUser(user.getName());
assert manager.getUser("dungtv") == null;
manager.addUser(session, user);
manager.removeUser((EzyUser) null);
}
Aggregations