@Test
public void shouldRemoveHistoriesAfterSuccessfulSync() throws Exception {

    String response = "{\"_id\" : \"couch_id\", \"child_name\":\"subhas\",\"unique_identifier\":\"78223s4h1e468f5200edc\"}";
    Enquiry enquirySpy = spy(new Enquiry(response, "createdBy"));
    enquirySpy.put(Enquiry.FIELD_INTERNAL_ID, "id");
    doReturn(false).when(enquirySpy).isNew();
    enquiryHttpDao = mock(EntityHttpDao.class);
    doReturn(enquirySpy).when(enquiryHttpDao).update(any(Enquiry.class), any(String.class), any(Map.class));
    new EnquirySyncService(mockContext(), enquiryHttpDao, enquiryRepository).sync(enquirySpy, user);
    verify(enquirySpy).remove(History.HISTORIES);
}