handling null pointer exception and updating integration tests for changes made as a part of FINERACT-590

This commit is contained in:
Vishwas Babu A J
2018-02-09 18:02:56 -08:00
parent 8ac5485544
commit e3ce5f3ae0
2 changed files with 5 additions and 2 deletions
@@ -373,8 +373,9 @@ public class AccountNumberPreferencesTest {
}
}
private void validateAccountNumberLengthAndStartsWithPrefix(final String accountNumber, final String prefix) {
private void validateAccountNumberLengthAndStartsWithPrefix(final String accountNumber, String prefix) {
if (prefix != null) {
prefix = prefix.substring(0, Math.min(prefix.length(), 10));
Assert.assertEquals(accountNumber.length(), prefix.length() + 9);
Assert.assertTrue(accountNumber.startsWith(prefix));
} else {
@@ -111,7 +111,9 @@ public class AccountNumberGenerator {
// FINERACT-590
// Because account_no is limited to 20 chars, we can only use the first 10 chars of prefix - trim if necessary
prefix = prefix.substring(0, Math.min(prefix.length(), 10));
if (prefix != null) {
prefix = prefix.substring(0, Math.min(prefix.length(), 10));
}
accountNumber = StringUtils.overlay(accountNumber, prefix, 0, 0);
}