@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"); }
@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()); }
@Test(dependsOnMethods = "create") public void read() throws Exception { Bed bed = repository.findOne(id); Assert.assertEquals("Available", bed.getAvailability()); }