Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. @Test
  2. public void newInstance_shouldCopyMostFields() throws Exception {
  3. Obs obs = new Obs();
  4. obs.setStatus(Obs.Status.PRELIMINARY);
  5. obs.setInterpretation(Obs.Interpretation.LOW);
  6. obs.setConcept(new Concept());
  7. obs.setValueNumeric(1.2);
  8.  
  9. Obs copy = Obs.newInstance(obs);
  10.  
  11. // these fields are not copied
  12. assertThat(copy.getObsId(), nullValue());
  13. assertThat(copy.getUuid(), not(obs.getUuid()));
  14.  
  15. // other fields are copied
  16. assertThat(copy.getConcept(), is(obs.getConcept()));
  17. assertThat(copy.getValueNumeric(), is(obs.getValueNumeric()));
  18. assertThat(copy.getStatus(), is(obs.getStatus()));
  19. assertThat(copy.getInterpretation(), is(obs.getInterpretation()));
  20. // TODO test that the rest of the fields are set
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement