/** Validates that validateSecurityCode returns false when an invalid security is set. */ public void testValidateSecurity_False() { EndowmentTargetTransactionSecurity targetTransactionSecurity = new EndowmentTargetTransactionSecurity(); targetTransactionSecurity.setSecurityID(EndowTestConstants.INVALID_SECURITY_ID); document.setTargetTransactionSecurity(targetTransactionSecurity); assertFalse(rule.validateSecurityCode(document, false)); }
/** Validates that validateSecurityCode returns true when a valid security is set. */ public void testValidateSecurity_True() { // add security details SecurityReportingGroup reportingGroup = SecurityReportingGroupFixture.REPORTING_GROUP.createSecurityReportingGroup(); EndowmentTransactionCode endowmentTransactionCode = EndowmentTransactionCodeFixture.INCOME_TRANSACTION_CODE.createEndowmentTransactionCode(); ClassCode classCode = ClassCodeFixture.LIABILITY_CLASS_CODE.createClassCodeRecord(); Security security = SecurityFixture.ACTIVE_SECURITY.createSecurityRecord(); EndowmentTargetTransactionSecurity targetTransactionSecurity = new EndowmentTargetTransactionSecurity(); targetTransactionSecurity.setSecurityID(security.getId()); targetTransactionSecurity.setSecurity(security); document.setTargetTransactionSecurity(targetTransactionSecurity); assertTrue(rule.validateSecurityCode(document, false)); }