@Test public void loadDoesNotAddBlankVersionInformation() throws ComponentLookupException { doReturn("").when(this.firstOntologyVersion).getStringValue("name"); doReturn(null).when(this.secondOntologyVersion).getStringValue("version"); PatientData<String> result = this.mocker.getComponentUnderTest().load(this.patient); Assert.assertEquals(PHENOTIPS_VERSION_STRING, result.get("phenotips_version")); Assert.assertEquals(1, result.size()); }
@Override public PatientData<String> load(Patient patient) { Map<String, String> versions = new LinkedHashMap<>(); try { XWikiDocument doc = patient.getXDocument(); addOntologyVersions(doc, versions); addPhenoTipsVersion(versions); } catch (Exception e) { this.logger.error(ERROR_MESSAGE_LOAD_FAILED, e.getMessage()); } return new DictionaryPatientData<>(getName(), versions); }
VersionsController extends AbstractSimpleController implements PatientDataController<String> { @Override public PatientData<String> load(Patient patient) { Map<String, String> versions = new LinkedHashMap<>(); try { XWikiDocument doc = patient.getXDocument(); addOntologyVersions(doc, versions); addPhenoTipsVersion(versions); } catch (Exception e) { this.logger.error(ERROR_MESSAGE_LOAD_FAILED, e.getMessage()); } return new DictionaryPatientData<>(getName(), versions); } }
VersionsController extends AbstractSimpleController implements PatientDataController<String> { @Override public PatientData<String> load(Patient patient) { Map<String, String> versions = new LinkedHashMap<>(); try { XWikiDocument doc = patient.getXDocument(); addOntologyVersions(doc, versions); addPhenoTipsVersion(versions); } catch (Exception e) { this.logger.error(ERROR_MESSAGE_LOAD_FAILED, e.getMessage()); } return new DictionaryPatientData<>(getName(), versions); }  }
VersionsController extends AbstractSimpleController implements PatientDataController<String> { @Override public PatientData<String> load(Patient patient) { Map<String, String> versions = new LinkedHashMap<>(); try { XWikiDocument doc = patient.getXDocument(); addOntologyVersions(doc, versions); addPhenoTipsVersion(versions); } catch (Exception e) { this.logger.error(ERROR_MESSAGE_LOAD_FAILED, e.getMessage()); } return new DictionaryPatientData<>(getName(), versions); }  @Override PatientData<String> load(Patient patient); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override String getName(); static String getEnablingFieldName(); }
VersionsController extends AbstractSimpleController implements PatientDataController<String> { @Override public PatientData<String> load(Patient patient) { Map<String, String> versions = new LinkedHashMap<>(); try { XWikiDocument doc = patient.getXDocument(); addOntologyVersions(doc, versions); addPhenoTipsVersion(versions); } catch (Exception e) { this.logger.error(ERROR_MESSAGE_LOAD_FAILED, e.getMessage()); } return new DictionaryPatientData<>(getName(), versions); }  @Override PatientData<String> load(Patient patient); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override String getName(); static String getEnablingFieldName();  }