From 1a879d8e2dfc3f6c0680eb94ee7dcc3eb096bfa8 Mon Sep 17 00:00:00 2001 From: JunRain Date: Sat, 17 Aug 2024 15:37:05 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20ExpenseServiceTest=20getMonthlyExpense?= =?UTF-8?q?=20=EB=A9=94=EC=84=9C=EB=93=9C=20categoryId=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=EC=97=90=20=EB=8C=80=ED=95=9C=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/expense/service/ExpenseServiceImplTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/com/bbteam/budgetbuddies/domain/expense/service/ExpenseServiceImplTest.java b/src/test/java/com/bbteam/budgetbuddies/domain/expense/service/ExpenseServiceImplTest.java index 11ecbf07..f0f5c05f 100644 --- a/src/test/java/com/bbteam/budgetbuddies/domain/expense/service/ExpenseServiceImplTest.java +++ b/src/test/java/com/bbteam/budgetbuddies/domain/expense/service/ExpenseServiceImplTest.java @@ -66,6 +66,7 @@ void getMonthlyExpense_Success() { given(userRepository.findById(user.getId())).willReturn(Optional.of(user)); Category userCategory = Mockito.spy(Category.builder().build()); + given(userCategory.getId()).willReturn(-1L); LocalDate requestMonth = LocalDate.of(2024, 07, 8); Pageable requestPage = PageRequest.of(0, pageSize); @@ -120,6 +121,7 @@ private List generateCompactExpenseResponseList(Local .expenseId((long)-i) .expenseDate(month.withDayOfMonth(i).atStartOfDay()) .amount(i * 100000L) + .categoryId(-1L) .build()); } return compactExpenses;