@Test public void writeJSON() throws ComponentLookupException { Map<String, Object> map = new LinkedHashMap<>(); map.put("date", this.dateStr); map.put("server", "monarchinitiative.org"); map.put("score", 0.25d); PatientData<Object> data = new DictionaryPatientData<>("specificity", map); when(this.patient.getData("specificity")).thenReturn(data); JSONObject json = new JSONObject(); this.mocker.getComponentUnderTest().writeJSON(this.patient, json); Assert.assertTrue(json.has("specificity")); json = json.getJSONObject("specificity"); Assert.assertEquals("monarchinitiative.org", json.getString("server")); Assert.assertEquals("2010-03-20T12:20:00.012Z", json.getString("date")); Assert.assertEquals(0.25d, json.getDouble("score"), 0.0); }
@Override public void writeJSON(Patient patient, JSONObject json) { writeJSON(patient, json, null); }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public void writeJSON(Patient patient, JSONObject json) { writeJSON(patient, json, null); } }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public void writeJSON(Patient patient, JSONObject json) { writeJSON(patient, json, null); }  }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public void writeJSON(Patient patient, JSONObject json) { writeJSON(patient, json, 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 void writeJSON(Patient patient, JSONObject json) { writeJSON(patient, json, 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();  }