Package org.springframework.data.jpa.showcase.core

Examples of org.springframework.data.jpa.showcase.core.Customer


  }

  @Test
  public void findsCustomerById() throws Exception {

    Customer customer = repository.findOne(2L);

    assertThat(customer.getFirstname(), is("Carter"));
    assertThat(customer.getLastname(), is("Beauford"));
  }
View Full Code Here


  }

  @Test
  public void findsCustomersBySpecification() throws Exception {

    Customer dave = repository.findOne(1L);

    LocalDate expiryLimit = new LocalDate(2011, 3, 1);
    List<Customer> result = repository.findAll(where(accountExpiresBefore(expiryLimit)));

    assertThat(result.size(), is(1));
View Full Code Here

  }

  @Test
  public void findsCustomersAccounts() {

    Customer customer = customerRepository.findOne(1L);
    List<Account> accounts = accountRepository.findByCustomer(customer);

    assertFalse(accounts.isEmpty());
    assertThat(accounts.get(0).getCustomer(), is(customer));
  }
View Full Code Here

  }

  @Test
  public void findsCustomerById() throws Exception {

    Customer customer = repository.findById(2L);

    assertThat(customer.getFirstname(), is("Carter"));
    assertThat(customer.getLastname(), is("Beauford"));
  }
View Full Code Here

  }

  @Test
  public void testname() throws Exception {

    Customer customer = customerService.findById(1L);

    List<Account> accounts = accountService.findByCustomer(customer);

    assertThat(accounts, is(not(empty())));
    assertThat(accounts.get(0).getCustomer(), is(customer));
View Full Code Here

  private CustomerRepository repository;

  public void findsCustomersBySpecification() throws Exception {

    Customer dave = repository.findOne(1L);

    LocalDate expiryLimit = new LocalDate(2011, 3, 1);
    List<Customer> result = repository.findAll(where(accountExpiresBefore(expiryLimit)));

    assertThat(result.size(), is(1));
View Full Code Here

TOP

Related Classes of org.springframework.data.jpa.showcase.core.Customer

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.