Package com.springsource.greenhouse.account

Examples of com.springsource.greenhouse.account.EmailAlreadyOnFileException


  }
 
  @Test
  public void signupFromApi_duplicateEmail() throws Exception {
    AccountRepository accountRepository = mock(AccountRepository.class);
    when(accountRepository.createAccount(any(Person.class))).thenThrow(new EmailAlreadyOnFileException("roy@clarkson.com"));
    SignedUpGateway gateway = mock(SignedUpGateway.class);   
    SignupController signupController = new SignupController(accountRepository, gateway);
   
    String signupJson = "{\"first-name\":\"Roy\",\"last-name\":\"Clarkson\",\"email\":\"roy@clarkson.com\",\"confirm-email\":\"roy@clarkson.com\",\"gender\":\"M\",\"birthdate\":{\"month\":7,\"day\":8,\"year\":1976},\"password\":\"letmein\"}";
    MockMvc mockMvc = standaloneSetup(signupController).build();
View Full Code Here


  }
 
  @Test
  public void signupFromApi_validationErrors() throws Exception {
    AccountRepository accountRepository = mock(AccountRepository.class);
    when(accountRepository.createAccount(any(Person.class))).thenThrow(new EmailAlreadyOnFileException("roy@clarkson.com"));
    SignedUpGateway gateway = mock(SignedUpGateway.class);   
    SignupController signupController = new SignupController(accountRepository, gateway);
   
    String signupJson = "{\"first-name\":null,\"last-name\":\"Clarkson\",\"email\":\"roy@clarkson.com\",\"confirm-email\":\"roy@clarkson.com\",\"gender\":\"M\",\"birthdate\":{\"month\":7,\"day\":8,\"year\":1976},\"password\":\"letmein\"}";
    MockMvc mockMvc = standaloneSetup(signupController).build();
View Full Code Here

  }
 
  @Test
  public void signupFromApi_mismatchedEmails() throws Exception {
    AccountRepository accountRepository = mock(AccountRepository.class);
    when(accountRepository.createAccount(any(Person.class))).thenThrow(new EmailAlreadyOnFileException("roy@clarkson.com"));
    SignedUpGateway gateway = mock(SignedUpGateway.class);   
    SignupController signupController = new SignupController(accountRepository, gateway);
   
    String signupJson = "{\"first-name\":\"Roy\",\"last-name\":\"Clarkson\",\"email\":\"roy@clarkson.com\",\"confirm-email\":\"rclarkson@vmware.com\",\"gender\":\"M\",\"birthdate\":{\"month\":7,\"day\":8,\"year\":1976},\"password\":\"letmein\"}";
    MockMvc mockMvc = standaloneSetup(signupController).build();
View Full Code Here

TOP

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

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.