IncidentRegisterPresenter extends RecordRegisterPresenter { @Override protected ItemValuesMap getItemValuesByRecordId(Long recordId) throws JSONException { Incident incidentItem = incidentService.getById(recordId); String incidentJson = new String(incidentItem.getContent().getBlob()); final ItemValuesMap itemValues = new ItemValuesMap(JsonUtils.toMap(new Gson().fromJson (incidentJson, JsonObject.class))); itemValues.addStringItem(IncidentService.INCIDENT_ID, incidentItem.getUniqueId()); addProfileItems(itemValues, incidentItem.getRegistrationDate(), incidentItem.getUniqueId(), null, recordId); return itemValues; } @Inject  IncidentRegisterPresenter(IncidentService incidentService, IncidentFormService
            incidentFormService); @Override void saveRecord(ItemValuesMap itemValuesMap, List<String> photoPaths,
                           RecordRegisterView.SaveRecordCallback callback); @Override List<Field> getFields(int position); @Override RecordForm getTemplateForm();  }
@Test public void should_return_item_values_map_by_record_id() throws JSONException, ParseException { Long recordId = 1L; Incident incidentItem = new Incident(); String uniqueId = "89fdj89r34jif9af90a"; incidentItem.setContent(new Blob("{\"age\":\"12\"}".getBytes())); incidentItem.setUniqueId(uniqueId); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd "); Date date = sdf.parse("2012-12-06 "); incidentItem.setRegistrationDate(date); when(incidentService.getById(recordId)).thenReturn(incidentItem); ItemValuesMap itemValuesMap = incidentRegisterPresenter.getItemValuesByRecordId(recordId); assertThat(itemValuesMap.getAsString("incident_id"), is("89fdj89r34jif9af90a")); }