Skip to content

Commit

Permalink
handling null pointer exception and updating integration tests for ch…
Browse files Browse the repository at this point in the history
…anges made as a part of FINERACT-590
  • Loading branch information
vishwasbabu committed Feb 10, 2018
1 parent 8ac5485 commit e3ce5f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,9 @@ private void createAndValidateClientBasedOnAccountPreference() {
}
}

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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ private String generateAccountNumber(Map<String, String> propertyMap, AccountNum

// 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);
}
Expand Down

0 comments on commit e3ce5f3

Please sign in to comment.