Exemplo n.º 1
0
 static {
   for (int cii = 1; cii <= 5; cii++) {
     User user = new User();
     user.setId(cii);
     user.setUserName("username" + cii);
     user.setPassword("passwordForUser" + cii);
     user.setPerfil("USER");
     user.setFirstName("demo " + cii);
     user.setLastName("user " + cii);
     user.setUri("/user-management/users/" + cii);
     user.setLastModified(new Date());
     users.put(user.getId(), user);
   }
   for (int cii = 6; cii <= 10; cii++) {
     User user = new User();
     user.setId(cii);
     user.setUserName("username" + cii);
     user.setPassword("passwordForUser" + cii);
     user.setPerfil("ADMIN");
     user.setFirstName("demo " + cii);
     user.setLastName("user " + cii);
     user.setUri("/user-management/users/" + cii);
     user.setLastModified(new Date());
     users.put(user.getId(), user);
   }
 }
Exemplo n.º 2
0
 public static void update(User user) {
   user.setLastModified(new Date());
   users.put(user.getId(), user);
 }