k-joseph

Untitled

Aug 27th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. /**
  2. * @see {@link EncounterService#saveEncounterType(EncounterType)}}
  3. * @see {@link EncounterService#checkIfEncounterTypesAreLocked()}}
  4. */
  5. @Test(expected = EncounterTypeLockedException.class)
  6. @Verifies(value = "should throw error when trying to save encounter type when encounter types are locked", method = "saveEncounterType(EncounterType)")
  7. public void saveEncounterType_shouldThrowErrorWhenTryingToSaveEncounterTypeWhenEncounterTypesAreLocked() throws Exception {
  8. GlobalProperty gp = new GlobalProperty(
  9. OpenmrsConstants.GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED);
  10. gp.setPropertyValue("true");
  11. Context.getAdministrationService().saveGlobalProperty(gp);
  12.  
  13. EncounterService encounterService = Context.getEncounterService();
  14. EncounterType encounterType = Context.getEncounterService().getEncounterType(1);
  15.  
  16. Assert.assertNotNull(encounterType);
  17.  
  18. encounterService.saveEncounterType(encounterType);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment