Я пытаюсь упростить мой тест с помощью DI (PicoContainer), но теперь он больше не работает корректно.
Я получаю эту ошибку: massages:
java.lang.NullPointerException
в org.javalite.activejdbc.Model.setRaw (Model.java:355)
в org.javalite.activejdbc.Model.setInteger (Model.java:1740)
на cash_withdrawal.Account. (Account.java:11)
на support.TestAccount. (TestAccount.java:7)
....
support.TestAccount:
public class TestAccount extends Account {
public TestAccount() {
super(1234);
saveIt();
}
}
cash_withdrawal.Account
public class Account extends Model {
private TransactionQueue queue = new TransactionQueue();
public Account() {}
public Account(int number){
setInteger("number", number);
setString("balance", "0.00");
}
}
Определение моего шага:
public class AccountSteps {
TestAccount account;
public AccountSteps(TestAccount account) {
this.account = account;
}
@Given("^my account has been credited with (\\$\\d+\\.\\d+)$")
public void myAccountHasBeenCreditedWith$(
@Transform(MoneyConverter.class) Money amount)
throws Throwable {
account.credit(amount);
}