@Test public void shouldAssignIdToPayment() throws Exception { final Nobt nobt = aNobt().build(); nobt.createPaymentFrom(aPaymentDraft().build()); assertThat(nobt, hasPayments( allOf( iterableWithSize(greaterThan(0)), everyItem( PaymentMatchers.hasId(notNullValue(Long.class)) ) ) )); }
public void createPaymentFrom(PaymentDraft paymentDraft) { final Payment payment = Payment.fromDraft(getNextIdentifier(), currencyKey, paymentDraft); payments.add(payment); }
Nobt { public void createPaymentFrom(PaymentDraft paymentDraft) { final Payment payment = Payment.fromDraft(getNextIdentifier(), currencyKey, paymentDraft); payments.add(payment); } }
Nobt { public void createPaymentFrom(PaymentDraft paymentDraft) { final Payment payment = Payment.fromDraft(getNextIdentifier(), currencyKey, paymentDraft); payments.add(payment); } Nobt(NobtId id, CurrencyKey currencyKey, String name, Set<Person> explicitParticipants, Set<Expense> expenses, Set<DeletedExpense> deletedExpenses, Set<Payment> payments, Instant createdOn, Optimizer optimizer); }
Nobt { public void createPaymentFrom(PaymentDraft paymentDraft) { final Payment payment = Payment.fromDraft(getNextIdentifier(), currencyKey, paymentDraft); payments.add(payment); } Nobt(NobtId id, CurrencyKey currencyKey, String name, Set<Person> explicitParticipants, Set<Expense> expenses, Set<DeletedExpense> deletedExpenses, Set<Payment> payments, Instant createdOn, Optimizer optimizer); NobtId getId(); CurrencyKey getCurrencyKey(); String getName(); Optimizer getOptimizer(); Set<Expense> getExpenses(); Set<DeletedExpense> getDeletedExpenses(); Set<Payment> getPayments(); Set<Person> getParticipatingPersons(); List<Debt> getOptimizedDebts(); Instant getCreatedOn(); void createExpenseFrom(ExpenseDraft expenseDraft); void createPaymentFrom(PaymentDraft paymentDraft); void deleteExpense(long expenseId); }
Nobt { public void createPaymentFrom(PaymentDraft paymentDraft) { final Payment payment = Payment.fromDraft(getNextIdentifier(), currencyKey, paymentDraft); payments.add(payment); } Nobt(NobtId id, CurrencyKey currencyKey, String name, Set<Person> explicitParticipants, Set<Expense> expenses, Set<DeletedExpense> deletedExpenses, Set<Payment> payments, Instant createdOn, Optimizer optimizer); NobtId getId(); CurrencyKey getCurrencyKey(); String getName(); Optimizer getOptimizer(); Set<Expense> getExpenses(); Set<DeletedExpense> getDeletedExpenses(); Set<Payment> getPayments(); Set<Person> getParticipatingPersons(); List<Debt> getOptimizedDebts(); Instant getCreatedOn(); void createExpenseFrom(ExpenseDraft expenseDraft); void createPaymentFrom(PaymentDraft paymentDraft); void deleteExpense(long expenseId);  }