Search in sources :

Example 36 with ConceptReferenceTerm

use of org.openmrs.ConceptReferenceTerm in project openmrs-core by openmrs.

the class ConceptServiceTest method retireConceptReferenceTerm_shouldShouldSetTheDefaultRetireReasonIfNoneIsGiven.

/**
 * @see ConceptService#retireConceptReferenceTerm(ConceptReferenceTerm,String)
 */
@Test
public void retireConceptReferenceTerm_shouldShouldSetTheDefaultRetireReasonIfNoneIsGiven() {
    ConceptReferenceTerm term = Context.getConceptService().getConceptReferenceTerm(1);
    term = Context.getConceptService().retireConceptReferenceTerm(term, null);
    Assert.assertNotNull(term.getRetireReason());
}
Also used : ConceptReferenceTerm(org.openmrs.ConceptReferenceTerm) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) Test(org.junit.Test)

Example 37 with ConceptReferenceTerm

use of org.openmrs.ConceptReferenceTerm 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());
}
Also used : ConceptSource(org.openmrs.ConceptSource) ConceptReferenceTerm(org.openmrs.ConceptReferenceTerm) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) Test(org.junit.Test)

Aggregations

ConceptReferenceTerm (org.openmrs.ConceptReferenceTerm)37 Test (org.junit.Test)33 BaseContextSensitiveTest (org.openmrs.test.BaseContextSensitiveTest)31 BindException (org.springframework.validation.BindException)19 Errors (org.springframework.validation.Errors)19 ConceptSource (org.openmrs.ConceptSource)7 ConceptReferenceTermMap (org.openmrs.ConceptReferenceTermMap)5 ArrayList (java.util.ArrayList)3 Ignore (org.junit.Ignore)3 Drug (org.openmrs.Drug)3 APIException (org.openmrs.api.APIException)3 HashSet (java.util.HashSet)2 List (java.util.List)2 Criteria (org.hibernate.Criteria)2 ConceptMap (org.openmrs.ConceptMap)2 ConceptMapType (org.openmrs.ConceptMapType)2 ConceptName (org.openmrs.ConceptName)2 DrugReferenceMap (org.openmrs.DrugReferenceMap)2 OpenmrsObject (org.openmrs.OpenmrsObject)2 ConceptService (org.openmrs.api.ConceptService)2