use of org.openmrs.ConceptSource in project openmrs-core by openmrs.
the class ConceptServiceTest method getConceptSourceByUuid_shouldFindObjectGivenValidUuid.
/**
* @see ConceptService#getConceptSourceByUuid(String)
*/
@Test
public void getConceptSourceByUuid_shouldFindObjectGivenValidUuid() {
String uuid = "75f5b378-5065-11de-80cb-001e378eb67e";
ConceptSource conceptSource = Context.getConceptService().getConceptSourceByUuid(uuid);
Assert.assertEquals(3, (int) conceptSource.getConceptSourceId());
}
use of org.openmrs.ConceptSource in project openmrs-core by openmrs.
the class ConceptServiceTest method getConceptSourceByName_shouldReturnNullIfNoConceptSourceWithThatNameIsFound.
@Test
public void getConceptSourceByName_shouldReturnNullIfNoConceptSourceWithThatNameIsFound() {
ConceptSource conceptSource = conceptService.getConceptSourceByName("Some invalid name");
assertNull("Method did not return null when no ConceptSource with that name is found", conceptSource);
}
use of org.openmrs.ConceptSource in project openmrs-core by openmrs.
the class ConceptServiceTest method getConceptReferenceTermByCode_shouldReturnAConceptReferenceTermThatMatchesTheGivenCodeFromTheGivenSource.
/**
* @see ConceptService#getConceptReferenceTermByCode(String,ConceptSource)
*/
@Test
public void getConceptReferenceTermByCode_shouldReturnAConceptReferenceTermThatMatchesTheGivenCodeFromTheGivenSource() {
ConceptReferenceTerm term = Context.getConceptService().getConceptReferenceTermByCode("2332523", new ConceptSource(2));
Assert.assertNotNull(term);
Assert.assertEquals("2332523", term.getCode());
}
use of org.openmrs.ConceptSource in project openmrs-core by openmrs.
the class ConceptServiceTest method saveConceptSource_shouldNotSetDateCreatedIfOneIsSuppliedAlready.
/**
* @see ConceptService#saveConceptSource(ConceptSource)
*/
@Test
public void saveConceptSource_shouldNotSetDateCreatedIfOneIsSuppliedAlready() {
Date expectedDate = new Date(new Date().getTime() - 10000);
ConceptSource newConceptSource = new ConceptSource();
newConceptSource.setName("name");
newConceptSource.setDescription("desc");
newConceptSource.setHl7Code("hl7Code");
newConceptSource.setDateCreated(expectedDate);
Context.getConceptService().saveConceptSource(newConceptSource);
Assert.assertEquals(DateUtil.truncateToSeconds(expectedDate), newConceptSource.getDateCreated());
}
Aggregations