Examples of AccountRepository


Examples of com.springsource.greenhouse.account.AccountRepository

public class SignupControllerTest {

  @Test
  public void signupFromApi_happyTest() throws Exception {
    AccountRepository accountRepository = mock(AccountRepository.class);   
    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

Examples of com.springsource.greenhouse.account.AccountRepository

        .andExpect(MockMvcResultMatchers.jsonPath("message", Matchers.equalTo("Account created")));
  }
 
  @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

Examples of com.springsource.greenhouse.account.AccountRepository

        .andExpect(MockMvcResultMatchers.jsonPath("errors[0].message", Matchers.equalTo("already on file")));
  }
 
  @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

Examples of com.springsource.greenhouse.account.AccountRepository

        .andExpect(MockMvcResultMatchers.jsonPath("errors[0].message", Matchers.equalTo("may not be empty")));
  }
 
  @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

Examples of de.olivergierke.whoops.repository.account.AccountRepository

class ApplicationConfiguration {

  @Bean
  public AccountRepository accountRepository() {

    AccountRepository repository = mock(AccountRepository.class);
    when(repository.save(any(Account.class))).thenAnswer(withArgument());
    return repository;
  }
View Full Code Here

Examples of rewards.internal.account.AccountRepository

  private RewardNetworkImpl rewardNetwork;

  @Before
  public void setUp() throws Exception {
    // create stubs to facilitate fast in-memory testing with dummy data and no external dependencies
    AccountRepository accountRepo = new StubAccountRepository();
    RestaurantRepository restaurantRepo = new StubRestaurantRepository();
    RewardRepository rewardRepo = new StubRewardRepository();

    // setup the object being tested by handing what it needs to work
    rewardNetwork = new RewardNetworkImpl(accountRepo, restaurantRepo, rewardRepo);
View Full Code Here

Examples of rewards.internal.account.AccountRepository

  private RewardNetworkImpl rewardNetwork;

  @Before
  public void setUp() throws Exception {
    // create stubs to facilitate fast in-memory testing with dummy data and no external dependencies
    AccountRepository accountRepo = new StubAccountRepository();
    RestaurantRepository restaurantRepo = new StubRestaurantRepository();
    RewardRepository rewardRepo = new StubRewardRepository();

    // setup the object being tested by handing what it needs to work
    rewardNetwork = new RewardNetworkImpl(accountRepo, restaurantRepo, rewardRepo);
View Full Code Here

Examples of rewards.internal.account.AccountRepository

  private RewardNetworkImpl rewardNetwork;

  @Override
  protected void setUp() throws Exception {
    // create stubs to facilitate fast in-memory testing with dummy data and no external dependencies
    AccountRepository accountRepo = new StubAccountRepository();
    RestaurantRepository restaurantRepo = new StubRestaurantRepository();
    RewardRepository rewardRepo = new StubRewardRepository();

    // setup the object being tested by handing what it needs to work
    rewardNetwork = new RewardNetworkImpl(accountRepo, restaurantRepo, rewardRepo);
View Full Code Here

Examples of rewards.internal.account.AccountRepository

    private RewardNetworkImpl rewardNetwork;

    @Before
    public void setUp() throws Exception {
        // create stubs to facilitate fast in-memory testing with dummy data and no external dependencies
        AccountRepository accountRepo = new StubAccountRepository();
        RestaurantRepository restaurantRepo = new StubRestaurantRepository();
        RewardRepository rewardRepo = new StubRewardRepository();

        // setup the object being tested by handing what it needs to work
        rewardNetwork = new RewardNetworkImpl(accountRepo, restaurantRepo, rewardRepo);
View Full Code Here

Examples of rewards.internal.account.AccountRepository

  private RewardNetworkImpl rewardNetwork;

  @Before
  public void setUp() throws Exception {
    // create stubs to facilitate fast in-memory testing with dummy data and no external dependencies
    AccountRepository accountRepo = new StubAccountRepository();
    RestaurantRepository restaurantRepo = new StubRestaurantRepository();
    RewardRepository rewardRepo = new StubRewardRepository();

    // setup the object being tested by handing what it needs to work
    rewardNetwork = new RewardNetworkImpl(accountRepo, restaurantRepo, rewardRepo);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.