Search in sources :

Example 1 with ExpenseUpdateInfo

use of ch.aaap.harvestclient.domain.param.ExpenseUpdateInfo in project harvest-client by 3AP-AG.

the class ExpensesApiUpdateTest method changeAll.

@Test
void changeAll() {
    String name = "test Expense";
    boolean billableByDefault = false;
    double defaultHourlyRate = 220.2;
    boolean defaultAddToFutureProject = true;
    boolean active = false;
    ExpenseUpdateInfo changes = ImmutableExpenseUpdateInfo.builder().project(project).expenseCategory(expenseCategory).totalCost(55.).spentDate(LocalDate.of(2001, 1, 1)).build();
    Expense updatedExpense = expensesApi.update(expense, changes);
    assertThat(updatedExpense).usingComparatorForType(Comparator.comparing(Reference::getId), Reference.class).isEqualToComparingOnlyGivenFields(changes, "project", "expenseCategory", "totalCost", "spentDate");
}
Also used : Reference(ch.aaap.harvestclient.domain.reference.Reference) ImmutableExpenseUpdateInfo(ch.aaap.harvestclient.domain.param.ImmutableExpenseUpdateInfo) ExpenseUpdateInfo(ch.aaap.harvestclient.domain.param.ExpenseUpdateInfo) HarvestTest(ch.aaap.harvestclient.HarvestTest) Test(org.junit.jupiter.api.Test)

Aggregations

HarvestTest (ch.aaap.harvestclient.HarvestTest)1 ExpenseUpdateInfo (ch.aaap.harvestclient.domain.param.ExpenseUpdateInfo)1 ImmutableExpenseUpdateInfo (ch.aaap.harvestclient.domain.param.ImmutableExpenseUpdateInfo)1 Reference (ch.aaap.harvestclient.domain.reference.Reference)1 Test (org.junit.jupiter.api.Test)1