@Test public void shouldSupportInterpretationProperty() throws Exception { Obs obs = new Obs(); assertThat(obs.getInterpretation(), nullValue()); obs.setInterpretation(Obs.Interpretation.NORMAL); assertThat(obs.getInterpretation(), is(Obs.Interpretation.NORMAL)); }
@Test public void newInstance_shouldCopyMostFields() throws Exception { Obs obs = new Obs(); obs.setStatus(Obs.Status.PRELIMINARY); obs.setInterpretation(Obs.Interpretation.LOW); obs.setConcept(new Concept()); obs.setValueNumeric(1.2); Obs copy = Obs.newInstance(obs); // these fields are not copied assertThat(copy.getObsId(), nullValue()); assertThat(copy.getUuid(), not(obs.getUuid())); // other fields are copied assertThat(copy.getConcept(), is(obs.getConcept())); assertThat(copy.getValueNumeric(), is(obs.getValueNumeric())); assertThat(copy.getStatus(), is(obs.getStatus())); assertThat(copy.getInterpretation(), is(obs.getInterpretation())); // TODO test that the rest of the fields are set }
newObs.setVoidReason(obsToCopy.getVoidReason()); newObs.setStatus(obsToCopy.getStatus()); newObs.setInterpretation(obsToCopy.getInterpretation());