Ejemplo n.º 1
0
 @Test(dependsOnMethods = "update")
 public void delete() throws Exception {
   Sales role = repository.findOne(id);
   repository.delete(role);
   Sales deletedRole = repository.findOne(id);
   Assert.assertNull(deletedRole);
 }
Ejemplo n.º 2
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);
  }
Ejemplo n.º 3
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);
 }
Ejemplo n.º 4
0
 @Test(dependsOnMethods = "create")
 public void read() throws Exception {
   Sales role = repository.findOne(id);
   Assert.assertNotNull(role);
 }