use of org.openmrs.ConceptProposal in project openmrs-core by openmrs.
the class ConceptServiceTest method mapConceptProposalToConcept_shouldAllowRejectingProposals.
/**
* @see ConceptService#mapConceptProposalToConcept(ConceptProposal,Concept)
*/
@Test
public void mapConceptProposalToConcept_shouldAllowRejectingProposals() {
String uuid = "af4ae460-0e2b-11e0-a94b-469c3c5a0c2f";
ConceptProposal proposal = Context.getConceptService().getConceptProposalByUuid(uuid);
Assert.assertNotNull("could not find proposal " + uuid, proposal);
// because there is a different unit test for the case when mapped proposal is null, we use a non-null concept here for our testing
Concept concept = conceptService.getConcept(3);
Assert.assertNotNull("could not find target concept to use for the test", concept);
proposal.setState(OpenmrsConstants.CONCEPT_PROPOSAL_REJECT);
Context.getConceptService().mapConceptProposalToConcept(proposal, concept);
// retrieve the proposal from the model and check its new state
ConceptProposal persisted = Context.getConceptService().getConceptProposalByUuid(uuid);
Assert.assertEquals(OpenmrsConstants.CONCEPT_PROPOSAL_REJECT, persisted.getState());
}
Aggregations