@Test
public void should_save_incident_when_give_item_values_and_item_values_map_have_register_date()
        throws IOException {

    String url = "http://35.61.65.113:8443";
    Mockito.when(PrimeroAppConfiguration.getApiBaseUrl()).thenReturn(url);
    String uniqueId = "test save incident";
    IncidentService incidentServiceSpy = spy(incidentService);
    when(incidentServiceSpy.generateUniqueId()).thenReturn(uniqueId);
    User user = new User("userName");
    when(PrimeroAppConfiguration.getCurrentUser()).thenReturn(user);
    ItemValuesMap itemValuesMap = new ItemValuesMap();
    itemValuesMap.addStringItem(DATE_OF_INTERVIEW, "1111/1111/11");
    Incident incident = incidentServiceSpy.save(itemValuesMap);
    when(incidentDao.save(any(Incident.class))).thenReturn(incident);
    assertThat(incident.getAge(), is(-1));
    assertThat(incident.getUniqueId(), is(uniqueId));
    assertThat(incident.getServerUrl(), is(TextUtils.lintUrl(url)));
    assertThat(incident.getRegistrationDate(), is(Utils.getRegisterDateByYyyyMmDd("1111/1111/11")));
    assertThat(incident.getRegistrationDate(), is(Utils.getRegisterDateByYyyyMmDd("1111/1111/11")));
}