Search in sources :

Example 1 with HomeAddress

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());
}
Also used : HomeAddress(org.motechproject.mds.test.domain.revertFromTrash.HomeAddress) Collection(java.util.Collection) QueryParams(org.motechproject.mds.query.QueryParams) Test(org.junit.Test)

Aggregations

Collection (java.util.Collection)1 Test (org.junit.Test)1 QueryParams (org.motechproject.mds.query.QueryParams)1 HomeAddress (org.motechproject.mds.test.domain.revertFromTrash.HomeAddress)1