Package com.springsource.greenhouse.account

Examples of com.springsource.greenhouse.account.Account


    this.mailer = mailer;
  }

  @Transactional
  public void sendResetMail(String username) throws SignInNotFoundException {
    Account account = accountRepository.findBySignin(username);
    String token = tokenGenerator.generateKey();
     jdbcTemplate.update("insert into ResetPassword (token, member) values (?, ?)", token, account.getId());
     mailer.send(new ResetPasswordRequest(token, account));
  }
View Full Code Here


   * @throws IllegalStateException when no user is authenticated.
   */
  @Bean
  @Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES
  public ConnectionRepository connectionRepository() {
    Account account = AccountUtils.getCurrentAccount();
    if (account == null) {
      throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
    }
    return usersConnectionRepository().createConnectionRepository(account.getId().toString());
  }
View Full Code Here

      request.setAttribute(USE_FACEBOOK_IMAGE_ATTRIBUTE, Boolean.TRUE, WebRequest.SCOPE_SESSION);
    }
  }

  public void postConnect(Connection<Facebook> connection, WebRequest request) {
    Account account = AccountUtils.getCurrentAccount();
    postToWall(connection, account, request);
    useFacebookProfileImage(connection, account, request);
  }
View Full Code Here

    this.accountRepository = accountRepository;
    this.requestCache = requestCache;
  }

  public String signIn(String userId, Connection<?> connection, NativeWebRequest request) {
    Account account = accountRepository.findById(Long.valueOf(userId));
    AccountUtils.signin(account);
    return extractOriginalUrl(request);
  }
View Full Code Here

    private Account account;
   
    @Before
    public void setup() {
        interceptor = new AccountExposingHandlerInterceptor();
        account = new Account(1L, "Joe", "Schmoe", "joe@schmoe.com", "joe", "file://pic.jpg", new UriTemplate("http://localhost:8080/members/{profileKey}"));
        TestingAuthenticationToken authentication = new TestingAuthenticationToken(account, "password");
        SecurityContextHolder.getContext().setAuthentication(authentication);
    }
View Full Code Here

      assertEquals("redirect:/settings", controller.disconnectApp("authme", testAccount()));
      assertEquals(0, tokenStore.findTokensByUserName("kdonald").size());
    }
 
    private Account testAccount() {
      return new Account(1L, "Joe", "Schmoe", "joe@schmoe.com", "joe", "file://pic.jpg", new UriTemplate("http://localhost:8080/members/{profileKey}"));
    }
View Full Code Here

  }

  @Test
  public void postConnect() {
    request.setAttribute("twitterConnect.postTweet", Boolean.TRUE, WebRequest.SCOPE_SESSION);
    Account account = new Account(2L, "Craig", "Walls", "cwalls@vmware.com", "habuma", "http://picture.com/url", new UriTemplate("http://greenhouse.springsource.org/members/{profile}"));
    AccountUtils.signin(account);
    //TwitterApi twitterApi = Mockito.mock(TwitterApi.class);
    //StubServiceProviderConnection<TwitterApi> connection = new StubServiceProviderConnection<TwitterApi>(twitterApi);
    //interceptor.postConnect(connection, request);
    //Mockito.verify(twitterApi).timelineOperations().updateStatus("Join me at the Greenhouse! http://greenhouse.springsource.org/members/habuma");
View Full Code Here

    //Mockito.verify(twitterApi).timelineOperations().updateStatus("Join me at the Greenhouse! http://greenhouse.springsource.org/members/habuma");
  }

  @Test
  public void postConnect_noPostTweetAttribute() {
    Account account = new Account(2L, "Craig", "Walls", "cwalls@vmware.com", "habuma", "http://picture.com/url", new UriTemplate("http://greenhouse.springsource.org/members/{profile}"));
    AccountUtils.signin(account);
    //TwitterApi twitterApi = Mockito.mock(TwitterApi.class);
    //StubServiceProviderConnection<TwitterApi> connection = new StubServiceProviderConnection<TwitterApi>(twitterApi);
    //interceptor.postConnect(connection, request);
    //Mockito.verifyZeroInteractions(twitterApi);
View Full Code Here

  }

  @Test
  public void markInviteAccepted() throws InviteException {
    jdbcTemplate.update("insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Keith', 'Donald', 'keith.donald@springsource.com', 'kdonald', 'melbourne', 'M', '1977-12-01')");
    Account signedUp = new Account(3L, "Keith", "Donald", "keith.donald@springsource.com", "kdonald", "http://localhost:8080/resources/profile-pics/3.jpg", new UriTemplate("http://localhost:8080/members/{id}"));
    inviteRepository.markInviteAccepted("abc", signedUp);
    try {
      inviteRepository.findInvite("abc");
      fail("Should have failed already accepted");
    } catch (InviteAlreadyAcceptedException e) {
View Full Code Here

    }
  }
 
  @Test
  public void inviteFlow() {
    Account account = new Account(1L, "Roy", "Clarkson", "rclarkson@vmware.com", "rclarkson", "http://localhost:8080/images/rclarkson.jpg", new UriTemplate("http://localhost:8080/members/{id}"));
    List<Invitee> invitees = new ArrayList<Invitee>();
    invitees.add(Invitee.valueOf("Keith Donald <keith.donald@springsource.com>"));
    invitees.add(Invitee.valueOf("Craig Walls <cwalls@vmware.com>"));
    String invitationText = "Come join me at the Greenhouse!";
    inviteService.sendInvite(account, invitees, invitationText);
View Full Code Here

TOP

Related Classes of com.springsource.greenhouse.account.Account

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.