Ejemplo n.º 1
0
 @Test(dependsOnMethods = "read")
 public void update() throws Exception {
   Bed bed = repository.findOne(id);
   Bed newBed = new Bed.Builder("Unavailable").copy(bed).build();
   repository.save(newBed);
   Bed updatedBed = repository.findOne(id);
   Assert.assertEquals(updatedBed.getAvailability(), "Available");
 }
Ejemplo n.º 2
0
 @Test
 public void create() throws Exception {
   Room room = RoomFactory.createRoom(50, 50, "Large");
   Bed bed = BedFactory.createBed("Available", room);
   repository.save(bed);
   id = bed.getBedNo();
   Assert.assertNotNull(bed.getBedNo());
   System.out.println(bed.getBedNo());
 }
Ejemplo n.º 3
0
 @Test(dependsOnMethods = "create")
 public void read() throws Exception {
   Bed bed = repository.findOne(id);
   Assert.assertEquals("Available", bed.getAvailability());
 }