public TemplateRuleTest() {
   GlobalVariables.setMessageMap(new MessageMap());
   GlobalVariables.setAuditErrorMap(new HashMap());
   prerequisite();
   assertEquals(expectedReturnValue, rule.processRules(event));
   checkRuleAssertions();
 }
Ejemplo n.º 2
0
  @Before
  public void setUp() throws Exception {
    awardFandaRateList = new ArrayList<AwardFandaRate>();
    awardDocumentRule = new AwardDocumentRule();
    awardFandaRate1 = new AwardFandaRate();
    awardFandaRate2 = new AwardFandaRate();
    awardReportTerm = new AwardReportTerm();

    awardFandaRate1.setApplicableFandaRate(new KualiDecimal(5));
    awardFandaRate1.setFiscalYear("2008");
    awardFandaRate1.setFandaRateTypeCode("5");
    awardFandaRate1.setOnCampusFlag("N");
    awardFandaRate1.setUnderrecoveryOfIndirectCost(new KualiDecimal(1000));
    awardFandaRate1.setStartDate(new Date(new Long("1183316613046")));
    awardFandaRate1.setEndDate(new Date(new Long("1214852613046")));
    awardFandaRate2.setApplicableFandaRate(new KualiDecimal(5));
    awardFandaRate2.setFiscalYear("2008");
    awardFandaRate2.setFandaRateTypeCode("5");
    awardFandaRate2.setOnCampusFlag("F");
    awardFandaRate2.setUnderrecoveryOfIndirectCost(new KualiDecimal(1000));
    awardFandaRate2.setStartDate(new Date(new Long("1183316613046")));
    awardFandaRate2.setEndDate(new Date(new Long("1214852613046")));
    awardFandaRateList.add(awardFandaRate1);
    awardFandaRateList.add(awardFandaRate2);

    GlobalVariables.setMessageMap(new MessageMap());
  }
 @Before
 public void setUp() throws Exception {
   approvedEquipmentRule = prepareTestReadyAwardApprovedEquipmentRule();
   award = new Award();
   award.setAwardId(1L);
   award.setAwardNumber("X1000");
   award.setSequenceNumber(1);
   String requirement = EquipmentCapitalizationMinimumLoader.INSTITUTION_REQUIREMENT;
   minimumCapitalizationInfo =
       new MinimumCapitalizationInfo(requirement, AMOUNT2, AMOUNT1, AMOUNT2);
   GlobalVariables.setMessageMap(new MessageMap());
 }
  @Before
  public void setUp() {
    context =
        new JUnit4Mockery() {
          {
            setThreadingPolicy(new Synchroniser());
          }
        };
    roleListBuilder = GenericQueryResults.Builder.create();
    roleListBuilder.setResults(
        new ArrayList<PropAwardPersonRole>() {
          {
            add(createTestRole(3L, "PI", PropAwardPersonRoleServiceImpl.NIH_MULTIPLE_PI_HIERARCHY));
            add(createTestRole(4L, "KP", PropAwardPersonRoleServiceImpl.NIH_MULTIPLE_PI_HIERARCHY));
            add(
                createTestRole(
                    5L, "MPI", PropAwardPersonRoleServiceImpl.NIH_MULTIPLE_PI_HIERARCHY));
            add(
                createTestRole(
                    6L, "COI", PropAwardPersonRoleServiceImpl.NIH_MULTIPLE_PI_HIERARCHY));
          }
        });

    rule = new AwardProjectPersonsSaveRuleImpl();
    award = new Award();
    award.setSponsorCode(SPONSOR_CODE);

    unitA = new Unit();
    unitA.setUnitName("a");
    unitA.setUnitNumber("1");

    unitB = new Unit();
    unitB.setUnitName("b");
    unitB.setUnitNumber("2");

    KcPerson employee = KcPersonFixtureFactory.createKcPerson(PERSON_ID);
    piPerson = new AwardPerson(employee, ContactRoleFixtureFactory.MOCK_PI);
    piPerson.add(new AwardPersonUnit(piPerson, unitA, true));

    NonOrganizationalRolodex nonEmployee;
    nonEmployee = new NonOrganizationalRolodex();
    nonEmployee.setRolodexId(ROLODEX_ID);
    coiPerson = new AwardPerson(nonEmployee, ContactRoleFixtureFactory.MOCK_COI);
    coiPerson.add(new AwardPersonUnit(coiPerson, unitA, false));

    KcPerson employee2 = KcPersonFixtureFactory.createKcPerson(KP_PERSON_ID);
    kpPerson = new AwardPerson(employee2, ContactRoleFixtureFactory.MOCK_KEY_PERSON);
    kpPerson.setKeyPersonRole("Tester");
    kpPerson.add(new AwardPersonUnit(kpPerson, unitA, false));

    piPerson.setAward(award);
    coiPerson.setAward(award);
    kpPerson.setAward(award);

    roleService = getPropAwardPersonRoleService();
    piPerson.setPropAwardPersonRoleService(roleService);
    coiPerson.setPropAwardPersonRoleService(roleService);
    kpPerson.setPropAwardPersonRoleService(roleService);

    award.add(piPerson);
    award.add(coiPerson);
    award.add(kpPerson);

    GlobalVariables.setMessageMap(new MessageMap());
  }