Use message in all Assert

This ensures compatibility with Spring 5.

Fixes gh-4193
This commit is contained in:
Rob Winch
2017-01-30 19:58:24 -06:00
parent 4c79107e01
commit 9c03571bbb
25 changed files with 67 additions and 67 deletions

View File

@@ -21,7 +21,7 @@ public class BankServiceImpl implements BankService {
private final BankDao bankDao;
public BankServiceImpl(BankDao bankDao) {
Assert.notNull(bankDao);
Assert.notNull(bankDao, "bankDao cannot be null");
this.bankDao = bankDao;
}
@@ -30,7 +30,7 @@ public class BankServiceImpl implements BankService {
}
public Account post(Account account, double amount) {
Assert.notNull(account);
Assert.notNull(account, "account cannot be null");
// We read account back from DAO so it reflects the latest balance
Account a = bankDao.readAccount(account.getId());

View File

@@ -22,7 +22,7 @@ public class SeedData implements InitializingBean {
private BankDao bankDao;
public void afterPropertiesSet() throws Exception {
Assert.notNull(bankDao);
Assert.notNull(bankDao, "bankDao cannot be null");
bankDao.createOrUpdateAccount(new Account("rod"));
bankDao.createOrUpdateAccount(new Account("dianne"));
bankDao.createOrUpdateAccount(new Account("scott"));

View File

@@ -29,7 +29,7 @@ public class ListAccounts implements Controller {
private final BankService bankService;
public ListAccounts(BankService bankService) {
Assert.notNull(bankService);
Assert.notNull(bankService, "bankService cannot be null");
this.bankService = bankService;
}

View File

@@ -31,7 +31,7 @@ public class PostAccounts implements Controller {
private final BankService bankService;
public PostAccounts(BankService bankService) {
Assert.notNull(bankService);
Assert.notNull(bankService, "bankService cannot be null");
this.bankService = bankService;
}