コード例 #1
0
  @Test
  public void testStart() throws Exception {
    MockExternalContext context = new MockExternalContext();
    when(hospitalManager.findAll()).thenReturn(new ArrayList<>());
    PersonObjectModel person = createMockPerson();
    MutableAttributeMap input = new LocalAttributeMap<>();
    input.put("person", person);

    startFlow(input, context);
    assertFlowExecutionActive();
    assertCurrentStateEquals(ENTER_PERSON_INFO);
  }
コード例 #2
0
  @Test
  public void testEnterIdentityCard() throws Exception {
    MockExternalContext context = new MockExternalContext();

    when(hospitalManager.findAll()).thenReturn(new ArrayList<>());
    when(personService.isNewPerson(any(PersonObjectModel.class))).thenReturn(true);

    PersonObjectModel person = createMockPerson();
    MutableAttributeMap input = new LocalAttributeMap<>();
    input.put("person", person);

    startFlow(input, context);
    assertFlowExecutionActive();
    assertCurrentStateEquals(ENTER_PERSON_INFO);

    context.setEventId("next");
    resumeFlow(context);
    assertFlowExecutionActive();
    assertCurrentStateEquals(ENTER_IC_INFO);
  }
コード例 #3
0
 @ModelAttribute
 private List<Hospital> getHospitals() {
   return hospitalManager.findAll();
 }