Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.openmrs.api;
- import static junit.framework.Assert.assertEquals;
- import static junit.framework.Assert.assertNotNull;
- import static junit.framework.Assert.assertTrue;
- import junit.framework.Assert;
- import org.junit.Ignore;
- import org.junit.Test;
- import org.openmrs.api.context.Context;
- import org.openmrs.notification.Note;
- import org.openmrs.notification.NoteService;
- import org.openmrs.test.BaseContextSensitiveTest;
- import org.openmrs.test.Verifies;
- public class NoteServiceTest extends BaseContextSensitiveTest {
- /**
- * @see {@link NoteService#voidNote(Note,String)}
- */
- //@Ignore
- @Test
- @Verifies(value = "should void the Note and set the voidReason", method = "voidNote(Note,String)")
- public void voidNote_shouldVoidTheNoteAndSetTheVoidReason() throws Exception {
- Note note = new Note();
- //note = Context.getNoteService().getNote(1);
- Assert.assertFalse(note.isVoided());
- Assert.assertNull(note.getVoidReason());
- Assert.assertNull(note.getDateVoided());
- Assert.assertNull(note.getDateVoided());
- note = Context.getNoteService().voidNote(note, "test reason");
- //assertTrue(note.isVoided());
- assertEquals("test reason", note.getVoidReason());
- assertEquals(Context.getAuthenticatedUser(), note.getVoidedBy());
- assertNotNull(note.getDateVoided());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement