use of ch.aaap.harvestclient.domain.reference.dto.ExpenseCategoryReferenceDto in project harvest-client by 3AP-AG.
the class ExpensesApiCreateTest method create.
@Test
void create() {
Expense creationInfo = ImmutableExpense.builder().project(project).expenseCategory(expenseCategory).spentDate(LocalDate.now()).user(user).totalCost(22.).build();
expense = expensesApi.create(creationInfo);
assertThat(expense).usingComparatorForType(Comparator.comparing(Reference::getId), Reference.class).isEqualToIgnoringNullFields(creationInfo);
ExpenseCategoryReferenceDto expenseCategoryDto = (ExpenseCategoryReferenceDto) expense.getExpenseCategory();
ExpenseCategory expectedCategory = harvest.expenseCategories().get(expenseCategory);
assertThat(expenseCategoryDto).isEqualToComparingOnlyGivenFields(expectedCategory, "unitName", "unitPrice");
}
Aggregations