Пример #1
0
  @Test(dependsOnMethods = "read")
  public void update() throws Exception {

    Sales role = repository.findOne(id);
    Sales newrole = new Sales.Builder(role.getSalesDate()).copy(role).build();
    // SAVE UPDATED ROLE
    repository.save(newrole);

    // GET THE SAVED ROLE

    Assert.assertEquals(newrole.getPrice(), 22.00);
  }
Пример #2
0
 @Test
 public void create() throws Exception {
   Beekeeper beekeepers = BeekeeperFactory.create("karl", "otto", "*****@*****.**");
   Location locations = LocationFactory.create("Darling", beekeepers);
   SubLocation subLocations = SubLocationFactory.create("Fossil", locations);
   Harvest harvests = HarvestFactory.create("Fossil", 66.00, subLocations);
   Customer customers = CustomerFactory.create("", "", "");
   Bucket buckets = BucketFactory.create(66.00, harvests);
   Sales role = SalesFactory.create("date", 22.00, buckets, customers);
   repository.save(role);
   id = role.getId();
   Assert.assertNotNull(role);
 }