Package org.onebusaway.users.services.internal

Examples of org.onebusaway.users.services.internal.UserRegistration


    Mockito.when(userDao.getUserIndexForId(key)).thenReturn(migratedIndex);

    UserIndexRegistrationService registrationService = Mockito.mock(UserIndexRegistrationService.class);
    _service.setUserIndexRegistrationService(registrationService);

    UserRegistration registration = new UserRegistration(1234, "5555");
    Mockito.when(registrationService.getRegistrationForUserIndexKey(key)).thenReturn(
        registration);

    UserPropertiesService userPropertiesService = Mockito.mock(UserPropertiesService.class);
    _service.setUserPropertiesService(userPropertiesService);
View Full Code Here


  }

  @Override
  public void setRegistrationForUserIndexKey(UserIndexKey key, int userId,
      String registrationCode) {
    Element element = new Element(key, new UserRegistration(userId,
        registrationCode));
    _cache.put(element);
  }
View Full Code Here

  @Override
  public UserIndex completePhoneNumberRegistration(UserIndex userIndex,
      String registrationCode) {

    UserRegistration registration = _userIndexRegistrationService.getRegistrationForUserIndexKey(userIndex.getId());
    if (registration == null)
      return null;

    String expectedCode = registration.getRegistrationCode();
    if (!expectedCode.equals(registrationCode))
      return null;

    /**
     * At this point, we have a valid registration code. We may safely clear the
     * registration
     */
    _userIndexRegistrationService.clearRegistrationForUserIndexKey(userIndex.getId());

    User targetUser = _userDao.getUserForId(registration.getUserId());
    if (targetUser == null)
      return null;

    User phoneUser = userIndex.getUser();

View Full Code Here

TOP

Related Classes of org.onebusaway.users.services.internal.UserRegistration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.