@Test public void testProjectRolesChanges() { // when a coi is changed to key person coiPerson.setContactRole(ContactRoleFixtureFactory.MOCK_KEY_PERSON); Assert.assertFalse( "Key Person Role not checked for", rule.checkForKeyPersonProjectRoles(award.getProjectPersons())); coiPerson.setKeyPersonRole("fromCOI"); Assert.assertTrue( "Key Person Role not checked for", rule.checkForKeyPersonProjectRoles(award.getProjectPersons())); // when a key person is changed to coi kpPerson.setContactRole(ContactRoleFixtureFactory.MOCK_COI); Assert.assertTrue( "rule should return true", rule.processSaveAwardProjectPersonsBusinessRules(award.getProjectPersons())); }
@Test public void testCheckForKeyPersonRole_NotFound() { kpPerson.setKeyPersonRole(null); Assert.assertFalse( "Key Person Role not checked for", rule.checkForKeyPersonProjectRoles(award.getProjectPersons())); checkErrorState( AwardProjectPersonsSaveRule.AWARD_PROJECT_PERSON_LIST_ERROR_KEY, AwardProjectPersonsSaveRule.ERROR_AWARD_PROJECT_KEY_PERSON_ROLE_REQUIRED); }
@Test public void testCheckForKeyPersonRole_Found() { Assert.assertTrue( "Key Person Role not checked for", rule.checkForKeyPersonProjectRoles(award.getProjectPersons())); }