Region deletedRegion = createStrictMock(Region.class);
expect(deletedRegion.getRegionWidgets()).andReturn(new ArrayList<RegionWidget>());
replay(deletedRegion);
regions.add(deletedRegion);
PageLayout prevLayout = createStrictMock(PageLayout.class);
expect(prevLayout.getNumberOfRegions()).andReturn(new Long(2)).anyTimes();
replay(prevLayout);
PageLayout layout = createStrictMock(PageLayout.class);
expect(layout.getNumberOfRegions()).andReturn(new Long(1)).anyTimes();
replay(layout);
regionRepository.delete(deletedRegion);
expect(regionRepository.save(region)).andReturn(region);
replay(regionRepository);