@Test
public void shouldUpdateEnquiryAttributesAfterSync() throws Exception {

    String response = "{\"_id\" : \"couch_id\", \"child_name\":\"subhas\",\"unique_identifier\":\"78223s4h1e468f5200edc\", \"last_updated_at\":\"2014-04-12\"}";
    Enquiry enquiry = spy(new Enquiry(response, "createdBy"));
    enquiry.put(Enquiry.FIELD_INTERNAL_ID, "id");
    doReturn(false).when(enquiry).isNew();
    BasicHttpResponse httpResponse = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
    httpResponse.setEntity(new StringEntity(response, ContentType.APPLICATION_JSON));
    getFakeHttpLayer().addHttpResponseRule("PUT", "http://whatever/api/enquiries/id", httpResponse);
    Enquiry returnedEnquiry = new EnquirySyncService(mockContext(), enquiryHttpDao, enquiryRepository).sync(enquiry, user);
    verify(enquiryRepository).createOrUpdateWithoutHistory(returnedEnquiry);
    assertNotNull(returnedEnquiry.getLastUpdatedAt());
    assertThat(returnedEnquiry.isSynced(), CoreMatchers.is(true));
}