@Test public void getState_shouldGetStateAssociatedWithGivenIdIfWorkflowStateIdExists() { final Integer EXISTING_WORKFLOW_STATE_ID = 1; ProgramWorkflowState state = pws.getState(EXISTING_WORKFLOW_STATE_ID); assertNotNull("ProgramWorkflowState not found", state); assertThat(state.getId(), is(EXISTING_WORKFLOW_STATE_ID)); }
@Override public void testResults(SubmissionResults results) { results.assertNoErrors(); results.assertEncounterCreated(); List<PatientProgram> pps = pws.getPatientPrograms(ps.getPatient(patientId), pws.getProgram(programId), null, null, null, null, false); Assert.assertEquals(1, pps.size()); //the user selected date should have been set Assert.assertEquals(ymdToDate(dateAsString(enrollmentDate)), ymdToDate(dateAsString(pps.get(0) .getDateEnrolled()))); //the initial state should have been set Assert.assertEquals(1, pps.get(0).getStates().size()); Assert.assertEquals(200, pps.get(0).getCurrentState(pws.getWorkflowByUuid("72a90efc-5140-11e1-a3e3-00248140a5eb")).getState() .getId().intValue()); };
/** * @see {@link HtmlFormEntryUtil#getState(String,Program)} */ @SuppressWarnings("deprecation") @Test @Verifies(value = "should return the state with the matching uuid", method = "getState(String,ProgramWorkflow)") public void getStateWorkflow_shouldReturnTheStateWithTheMatchingUuid() throws Exception { Assert.assertEquals("1",HtmlFormEntryUtil.getState("92584cdc-6a20-4c84-a659-e035e45d36b0", Context.getProgramWorkflowService().getWorkflow(1)).getId().toString()); }
/** * @see {@link HtmlFormEntryUtil#getState(String,Program)} */ @Test @Verifies(value = "should return the state with the matching uuid", method = "getState(String,Program)") public void getStateProgram_shouldReturnTheStateWithTheMatchingUuid() throws Exception { Assert.assertEquals("1",HtmlFormEntryUtil.getState("92584cdc-6a20-4c84-a659-e035e45d36b0", Context.getProgramWorkflowService().getProgram(1)).getId().toString()); }