@Test public void writeJSONWithSelectedFieldsAddsAllValuesWhenSelectedFieldsNull() { String notes = "some notes about the solved case"; String pubmedID = "pubmed:0001"; SolvedData data = new SolvedData("1", notes, Arrays.asList(pubmedID)); PatientData<SolvedData> patientData = new SimpleValuePatientData<>(DATA_NAME, data); doReturn(patientData).when(this.patient).getData(DATA_NAME); JSONObject json = new JSONObject(); this.component.writeJSON(this.patient, json, null); JSONObject container = json.getJSONObject(DATA_NAME); Assert.assertEquals(STATUS_SOLVED, container.get("status")); Assert.assertEquals(pubmedID, ((JSONArray) container.get("pubmed_id")).get(0)); Assert.assertEquals(notes, container.get("notes")); }
@SuppressWarnings("checkstyle:CyclomaticComplexity") @Override public void writeJSON(Patient patient, JSONObject json) { this.writeJSON(patient, json, null); }
SolvedController implements PatientDataController<SolvedData> { @SuppressWarnings("checkstyle:CyclomaticComplexity") @Override public void writeJSON(Patient patient, JSONObject json) { this.writeJSON(patient, json, null); } }
SolvedController implements PatientDataController<SolvedData> { @SuppressWarnings("checkstyle:CyclomaticComplexity") @Override public void writeJSON(Patient patient, JSONObject json) { this.writeJSON(patient, json, null); }  }
SolvedController implements PatientDataController<SolvedData> { @SuppressWarnings("checkstyle:CyclomaticComplexity") @Override public void writeJSON(Patient patient, JSONObject json) { this.writeJSON(patient, json, null); }  @Override String getName(); @Override PatientData<SolvedData> load(Patient patient); @Override void save(Patient patient); @Override void save(@Nonnull final Patient patient, @Nonnull final PatientWritePolicy policy); @SuppressWarnings("checkstyle:CyclomaticComplexity") @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<SolvedData> readJSON(JSONObject json); }
SolvedController implements PatientDataController<SolvedData> { @SuppressWarnings("checkstyle:CyclomaticComplexity") @Override public void writeJSON(Patient patient, JSONObject json) { this.writeJSON(patient, json, null); }  @Override String getName(); @Override PatientData<SolvedData> load(Patient patient); @Override void save(Patient patient); @Override void save(@Nonnull final Patient patient, @Nonnull final PatientWritePolicy policy); @SuppressWarnings("checkstyle:CyclomaticComplexity") @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<SolvedData> readJSON(JSONObject json);  }