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");
}
}
Aggregations