use of org.motechproject.mds.test.domain.revertFromTrash.HomeAddress in project motech by motech.
the class MdsDdeBundleIT method shouldRevertFromTrash.
@Test
public void shouldRevertFromTrash() {
HomeAddress homeAddress1 = revertFromTrashService.create(new HomeAddress("street1", "city1"));
HomeAddress homeAddress2 = revertFromTrashService.create(new HomeAddress("street2", "city2"));
revertFromTrashService.delete(homeAddress1);
revertFromTrashService.delete(homeAddress2);
revertFromTrashService.revertFromTrash(homeAddress1.getId());
QueryParams q = new QueryParams(1, 10);
Collection instancesInTrash = trashService.getInstancesFromTrash(HomeAddress.class.getName(), q);
Collection<HomeAddress> instancesOutsideTrash = revertFromTrashService.retrieveAll();
assertEquals(1, instancesInTrash.size());
assertEquals(1, instancesOutsideTrash.size());
}
Aggregations