Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. /**
  2. * @see {@link EncounterService#saveEncounterType(EncounterType)}}
  3. * @see {@link EncounterService#checkIfEncounterTypesAreLocked()}}
  4. */
  5. @Test
  6. @Verifies(value = "not save encounter type if encounter types are locked", method = "saveEncounterType(EncounterType)")
  7. public void saveEncounterType_shouldNotSaveEncounterTypeIfEncounterTypesAreLocked() throws Exception {
  8. EncounterService encounterService = Context.getEncounterService();
  9. EncounterType encounterType = new EncounterType("testing", "desc");
  10.  
  11. String locked = Context.getAdministrationService().getGlobalProperty(
  12. OpenmrsConstants.GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED, "false");
  13. if (!locked.toLowerCase().equals("true")) {
  14. encounterService.saveEncounterType(encounterType);
  15. }
  16. // making sure an encounter type id was not created
  17. assertNull(encounterType.getEncounterTypeId());
  18.  
  19. // make sure we cannot fetch this new encounter type from the database
  20. EncounterType newEncounterType = encounterService.getEncounterType(encounterType.getEncounterTypeId());
  21. assertNull(newEncounterType);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement