refactor: tests

This commit is contained in:
effe 2024-09-12 19:54:25 -04:00
parent 0702bddc6c
commit 1b1c1ce312
2 changed files with 1 additions and 6 deletions

View file

@ -41,7 +41,7 @@ class ExpenseServiceTest {
} }
@Test @Test
public void testFetchExpensesForDashboard_NoExpenses() { void testFetchExpensesForDashboard_NoExpenses() {
when(expenseRepository.findExpensesByPayerAndBeneficiaryAndYear(loggedInPerson.getId(), year.getValue())) when(expenseRepository.findExpensesByPayerAndBeneficiaryAndYear(loggedInPerson.getId(), year.getValue()))
.thenReturn(new ArrayList<>()); .thenReturn(new ArrayList<>());
when(expenseRepository.findExpensesByBeneficiaryAndYear(loggedInPerson.getId(), year.getValue())) when(expenseRepository.findExpensesByBeneficiaryAndYear(loggedInPerson.getId(), year.getValue()))

View file

@ -38,10 +38,6 @@ class PersonServiceTest {
person2.setLastName("second"); person2.setLastName("second");
person2.setFirstName("person"); person2.setFirstName("person");
// Person person3 = new Person();
// person3.setLastName("third");
// person3.setFirstName("person");
Expense expense1 = mock(Expense.class); Expense expense1 = mock(Expense.class);
when(expense1.getPayer()).thenReturn(person); when(expense1.getPayer()).thenReturn(person);
when(expense1.getBeneficiary()).thenReturn(person2); when(expense1.getBeneficiary()).thenReturn(person2);
@ -180,5 +176,4 @@ class PersonServiceTest {
// Assert // Assert
assertEquals(new BigDecimal("-50.00"), totalDebt); assertEquals(new BigDecimal("-50.00"), totalDebt);
} }
} }