@Test public void loadWithNoSpecificityDoesNothing() throws ComponentLookupException { when(this.service.getSpecificity(this.patient)).thenReturn(null); Assert.assertNull(this.mocker.getComponentUnderTest().load(this.patient)); }
@Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; } }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; }  }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; }  @Override void initialize(); @Override PatientData<Object> load(Patient patient); @Override void save(Patient patient); @Override void save(final Patient patient, final PatientWritePolicy policy); @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<Object> readJSON(JSONObject json); @Override String getName(); }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; }  @Override void initialize(); @Override PatientData<Object> load(Patient patient); @Override void save(Patient patient); @Override void save(final Patient patient, final PatientWritePolicy policy); @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<Object> readJSON(JSONObject json); @Override String getName();  }