/** * @see {@link HtmlFormEntryUtil#getProgram(String)} */ @Test @Verifies(value = "should return null otherwise", method = "getProgram(String)") public void getPatientIdentifierType_shouldReturnNullOtherwise() throws Exception { String id = null; Assert.assertNull(HtmlFormEntryUtil.getPatientIdentifierType(id)); id = ""; Assert.assertNull(HtmlFormEntryUtil.getPatientIdentifierType(id)); id = "100000";//not exist in the standardTestData Assert.assertNull(HtmlFormEntryUtil.getPatientIdentifierType(id)); id = "ASDFASDFEAF";//random string Assert.assertNull(HtmlFormEntryUtil.getPatientIdentifierType(id)); id = "-";//uuid style Assert.assertNull(HtmlFormEntryUtil.getPatientIdentifierType(id)); }
PatientIdentifierType idType = HtmlFormEntryUtil.getPatientIdentifierType(attributes.get("identifierTypeId"));
/** * @see {@link HtmlFormEntryUtil#getPatientIdentifierType(String)} this is the name test */ @Test @Verifies(value = "should find a program by its name", method = "getPatientIdentifierType(String)") public void getPatientIdentifierType_shouldFindAPatientIdentifierTypeByItsName() throws Exception { Assert.assertEquals("1a339fe9-38bc-4ab3-b180-320988c0b968", HtmlFormEntryUtil.getPatientIdentifierType("OpenMRS Identification Number").getUuid()); }
/** * @see {@link HtmlFormEntryUtil#getPatientIdentifierType(String)} this is the uuid test */ @Test @Verifies(value = "should find a patient identifier type by its uuid", method = "getPatientIdentifierType(String)") public void getPatientIdentifierType_shouldFindAPatientIdentifierTypeByItsUuid() throws Exception { Assert.assertEquals("OpenMRS Identification Number", HtmlFormEntryUtil.getPatientIdentifierType("1a339fe9-38bc-4ab3-b180-320988c0b968").getName()); }
/** * @see {@link HtmlFormEntryUtil#getPatientIdentifierType(String)} id test */ @Test @Verifies(value = "should find a patient identifier type by its Id", method = "getPatientIdentifierType(String)") public void getPatientIdentifierType_shouldFindAPatientIdentifierTypeByItsId() throws Exception { Assert.assertEquals("OpenMRS Identification Number", HtmlFormEntryUtil.getPatientIdentifierType("1").getName()); }