handling null pointer exception and updating integration tests for changes made as a part of FINERACT-590
This commit is contained in:
+2
-1
@@ -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) {
|
if (prefix != null) {
|
||||||
|
prefix = prefix.substring(0, Math.min(prefix.length(), 10));
|
||||||
Assert.assertEquals(accountNumber.length(), prefix.length() + 9);
|
Assert.assertEquals(accountNumber.length(), prefix.length() + 9);
|
||||||
Assert.assertTrue(accountNumber.startsWith(prefix));
|
Assert.assertTrue(accountNumber.startsWith(prefix));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+3
-1
@@ -111,7 +111,9 @@ public class AccountNumberGenerator {
|
|||||||
|
|
||||||
// FINERACT-590
|
// FINERACT-590
|
||||||
// Because account_no is limited to 20 chars, we can only use the first 10 chars of prefix - trim if necessary
|
// 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);
|
accountNumber = StringUtils.overlay(accountNumber, prefix, 0, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user