Search in sources :

Example 6 with Proposal

use of org.kuali.kfs.module.cg.businessobject.Proposal in project cu-kfs by CU-CommunityApps.

the class ezraUpdateProposalImplTest method testUpdateProposal.

public void testUpdateProposal() {
    List ezraProposals = unitTestSqlDao.sqlSelect(GET_PROPOSAL_NUMBER_SQL);
    Map proposalNumberResult = (Map) ezraProposals.get(0);
    Object proposalNumber = proposalNumberResult.get("PROJ_ID");
    Map fields = new HashMap();
    fields.clear();
    fields.put("proposalNumber", proposalNumber);
    String grantIdTest = "ezraUpdateTest";
    String grantIdAfter = "";
    Proposal proposal = (Proposal) businessObjectService.findByPrimaryKey(Proposal.class, fields);
    String startGrant = proposal.getGrantNumber();
    proposal.setGrantNumber(grantIdTest);
    businessObjectService.save(proposal);
    assertTrue(ezraService.updateProposals());
    Proposal proposalAfterUpdate = (Proposal) businessObjectService.findByPrimaryKey(Proposal.class, fields);
    grantIdAfter = proposalAfterUpdate.getGrantNumber();
    LOG.info("Grant Number before update " + grantIdTest + " Grant Number after update " + grantIdAfter + " Started with " + startGrant);
    if (grantIdTest.equalsIgnoreCase(grantIdAfter)) {
        fail("Ezra failed to update proposal");
    }
}
Also used : HashMap(java.util.HashMap) List(java.util.List) Map(java.util.Map) HashMap(java.util.HashMap) Proposal(org.kuali.kfs.module.cg.businessobject.Proposal)

Aggregations

Proposal (org.kuali.kfs.module.cg.businessobject.Proposal)6 HashMap (java.util.HashMap)3 Map (java.util.Map)3 Award (org.kuali.kfs.module.cg.businessobject.Award)3 CuAward (edu.cornell.kfs.module.cg.businessobject.CuAward)2 EzraProposalAward (edu.cornell.kfs.module.ezra.businessobject.EzraProposalAward)2 EzraProject (edu.cornell.kfs.module.ezra.businessobject.EzraProject)1 List (java.util.List)1 Agency (org.kuali.kfs.module.cg.businessobject.Agency)1 CFDA (org.kuali.kfs.module.cg.businessobject.CFDA)1 ProposalOrganization (org.kuali.kfs.module.cg.businessobject.ProposalOrganization)1 ProposalProjectDirector (org.kuali.kfs.module.cg.businessobject.ProposalProjectDirector)1