Advertisement
Guest User

Untitled

a guest
Apr 16th, 2013
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. package org.openmrs.api;
  2.  
  3. import static junit.framework.Assert.assertEquals;
  4. import static junit.framework.Assert.assertNotNull;
  5. import static junit.framework.Assert.assertTrue;
  6. import junit.framework.Assert;
  7.  
  8. import org.junit.Ignore;
  9. import org.junit.Test;
  10. import org.openmrs.api.context.Context;
  11. import org.openmrs.notification.Note;
  12. import org.openmrs.notification.NoteService;
  13. import org.openmrs.test.BaseContextSensitiveTest;
  14. import org.openmrs.test.Verifies;
  15.  
  16. public class NoteServiceTest extends BaseContextSensitiveTest {
  17.  
  18. /**
  19. * @see {@link NoteService#voidNote(Note,String)}
  20. */
  21. //@Ignore
  22. @Test
  23. @Verifies(value = "should void the Note and set the voidReason", method = "voidNote(Note,String)")
  24. public void voidNote_shouldVoidTheNoteAndSetTheVoidReason() throws Exception {
  25.  
  26. Note note = new Note();
  27. //note = Context.getNoteService().getNote(1);
  28. Assert.assertFalse(note.isVoided());
  29. Assert.assertNull(note.getVoidReason());
  30. Assert.assertNull(note.getDateVoided());
  31. Assert.assertNull(note.getDateVoided());
  32.  
  33. note = Context.getNoteService().voidNote(note, "test reason");
  34. //assertTrue(note.isVoided());
  35. assertEquals("test reason", note.getVoidReason());
  36. assertEquals(Context.getAuthenticatedUser(), note.getVoidedBy());
  37. assertNotNull(note.getDateVoided());
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement