@Test public void testNcreateAnonymousUser() { User user = null; try { user = _userService.createAnonymous(); } catch (IpatException e) { String errorCode = e.getErrorInfos().get(0).getErrorCode(); fail("creating anonymous should not fail here\nerrorCode:" + errorCode); } assertNotNull(user); }
public User createAnonymous() throws IpatException { User user = null; final long currentTimeMillis = System.currentTimeMillis(); final String randomString = UUID.randomUUID().toString(); String userName = createAnonymousUserName(); user = new User(); user.setName(userName); user.setEnabled(false); user.setBanned(false); user.setRegDate(currentTimeMillis); user.setLastVisit(currentTimeMillis); user.setOrganizationType(OrganizationType.PRIVATE); user.addRole(Role.USER); user.setActivationKey(randomString); user.setLang(Language.DEUTSCH); userRepository.save(user); return user; }
UserService { public User createAnonymous() throws IpatException { User user = null; final long currentTimeMillis = System.currentTimeMillis(); final String randomString = UUID.randomUUID().toString(); String userName = createAnonymousUserName(); user = new User(); user.setName(userName); user.setEnabled(false); user.setBanned(false); user.setRegDate(currentTimeMillis); user.setLastVisit(currentTimeMillis); user.setOrganizationType(OrganizationType.PRIVATE); user.addRole(Role.USER); user.setActivationKey(randomString); user.setLang(Language.DEUTSCH); userRepository.save(user); return user; } }
UserService { public User createAnonymous() throws IpatException { User user = null; final long currentTimeMillis = System.currentTimeMillis(); final String randomString = UUID.randomUUID().toString(); String userName = createAnonymousUserName(); user = new User(); user.setName(userName); user.setEnabled(false); user.setBanned(false); user.setRegDate(currentTimeMillis); user.setLastVisit(currentTimeMillis); user.setOrganizationType(OrganizationType.PRIVATE); user.addRole(Role.USER); user.setActivationKey(randomString); user.setLang(Language.DEUTSCH); userRepository.save(user); return user; }  }
UserService { public User createAnonymous() throws IpatException { User user = null; final long currentTimeMillis = System.currentTimeMillis(); final String randomString = UUID.randomUUID().toString(); String userName = createAnonymousUserName(); user = new User(); user.setName(userName); user.setEnabled(false); user.setBanned(false); user.setRegDate(currentTimeMillis); user.setLastVisit(currentTimeMillis); user.setOrganizationType(OrganizationType.PRIVATE); user.addRole(Role.USER); user.setActivationKey(randomString); user.setLang(Language.DEUTSCH); userRepository.save(user); return user; }  User createAnonymous(); UserReportData getUserDetails(String userName, boolean isEditAllowed); void editUser(String userName, String toEdit, String newEntry); String uploadUserImage(String userName, MultipartFile file); void registrateUser(UserRegistrationData userRegistrationData); void activateUser(long userId, String key); void createPasswordResetMail(String userName); String verifiyPasswordResetLink(long userId, String key); String resetPasswordForUser(long userId, String key, String password); User anonymizeUser(String userName); }
UserService { public User createAnonymous() throws IpatException { User user = null; final long currentTimeMillis = System.currentTimeMillis(); final String randomString = UUID.randomUUID().toString(); String userName = createAnonymousUserName(); user = new User(); user.setName(userName); user.setEnabled(false); user.setBanned(false); user.setRegDate(currentTimeMillis); user.setLastVisit(currentTimeMillis); user.setOrganizationType(OrganizationType.PRIVATE); user.addRole(Role.USER); user.setActivationKey(randomString); user.setLang(Language.DEUTSCH); userRepository.save(user); return user; }  User createAnonymous(); UserReportData getUserDetails(String userName, boolean isEditAllowed); void editUser(String userName, String toEdit, String newEntry); String uploadUserImage(String userName, MultipartFile file); void registrateUser(UserRegistrationData userRegistrationData); void activateUser(long userId, String key); void createPasswordResetMail(String userName); String verifiyPasswordResetLink(long userId, String key); String resetPasswordForUser(long userId, String key, String password); User anonymizeUser(String userName);  }