Пример #1
0
  /**
   * Test an invalid assignment, no committee selected.
   *
   * @throws Exception
   */
  @Test
  public void testNoCommittee() throws Exception {
    ProtocolDocument protocolDocument = ProtocolFactory.createProtocolDocument();

    ProtocolAssignCmtSchedBean actionBean = new ProtocolAssignCmtSchedBean(null);
    actionBean.setCommitteeId("");

    assertFalse(rule.processAssignToCommitteeSchedule(protocolDocument, actionBean));
    assertError(
        Constants.PROTOCOL_ASSIGN_CMT_SCHED_ACTION_PROPERTY_KEY + ".committeeId",
        KeyConstants.ERROR_PROTOCOL_COMMITTEE_NOT_SELECTED);
  }
Пример #2
0
  /**
   * Test a valid assignment.
   *
   * @throws Exception
   */
  @SuppressWarnings("deprecation")
  @Test
  public void testHasCommittee() throws Exception {

    ProtocolDocument protocolDocument = ProtocolFactory.createProtocolDocument();

    ProtocolAssignCmtSchedBean actionBean = new ProtocolAssignCmtSchedBean(null);
    actionBean.setCommitteeId("1");

    assertTrue(rule.processAssignToCommitteeSchedule(protocolDocument, actionBean));
    assertEquals(GlobalVariables.getMessageMap().getErrorMessages().size(), 0);
  }