use of org.openmrs.ProgramWorkflowState in project openmrs-core by openmrs.
the class ProgramWorkflowServiceUnitTest method saveProgram_shouldFailIfProgramWorkFlowStateConceptIsNull.
@Test
public void saveProgram_shouldFailIfProgramWorkFlowStateConceptIsNull() {
exception.expect(APIException.class);
exception.expectMessage("ProgramWorkflowState concept, initial, terminal are required");
Program program = new Program();
program.setName("TEST PROGRAM");
program.setDescription("TEST PROGRAM DESCRIPTION");
program.setConcept(new Concept(1));
ProgramWorkflow workflow = new ProgramWorkflow();
workflow.setConcept(new Concept(2));
ProgramWorkflowState state1 = new ProgramWorkflowState();
state1.setInitial(true);
state1.setTerminal(false);
workflow.addState(state1);
program.addWorkflow(workflow);
pws.saveProgram(program);
}
use of org.openmrs.ProgramWorkflowState in project openmrs-core by openmrs.
the class ProgramWorkflowServiceUnitTest method saveProgram_shouldFailIfProgramWorkFlowStateInitialIsNull.
@Test
public void saveProgram_shouldFailIfProgramWorkFlowStateInitialIsNull() {
exception.expect(APIException.class);
exception.expectMessage("ProgramWorkflowState concept, initial, terminal are required");
Program program = new Program();
program.setName("TEST PROGRAM");
program.setDescription("TEST PROGRAM DESCRIPTION");
program.setConcept(new Concept(1));
ProgramWorkflow workflow = new ProgramWorkflow();
workflow.setConcept(new Concept(2));
ProgramWorkflowState state1 = new ProgramWorkflowState();
state1.setConcept(new Concept(3));
state1.setTerminal(false);
workflow.addState(state1);
program.addWorkflow(workflow);
pws.saveProgram(program);
}
Aggregations