diff --git a/src/main/java/com/example/springbootbookshop/repository/OrderRepository.java b/src/main/java/com/example/springbootbookshop/repository/OrderRepository.java index 205f6a5..01c8b0b 100644 --- a/src/main/java/com/example/springbootbookshop/repository/OrderRepository.java +++ b/src/main/java/com/example/springbootbookshop/repository/OrderRepository.java @@ -1,8 +1,8 @@ package com.example.springbootbookshop.repository; import com.example.springbootbookshop.entity.Order; +import java.util.List; import java.util.Optional; -import java.util.Set; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.EntityGraph; import org.springframework.data.jpa.repository.JpaRepository; @@ -14,5 +14,5 @@ public interface OrderRepository extends JpaRepository { Optional findOrderByIdAndUserId(Long orderId, Long userId); @EntityGraph(attributePaths = {"user", "orderItems"}) - Set findAllByUserId(Long userId, Pageable pageable); + List findAllByUserId(Long userId, Pageable pageable); } diff --git a/src/test/java/com/example/springbootbookshop/controller/BookControllerTest.java b/src/test/java/com/example/springbootbookshop/controller/BookControllerTest.java index 2c47f89..957c7b2 100644 --- a/src/test/java/com/example/springbootbookshop/controller/BookControllerTest.java +++ b/src/test/java/com/example/springbootbookshop/controller/BookControllerTest.java @@ -170,7 +170,7 @@ void getBookById_ValidId_Ok() throws Exception { void deleteBookByIdAssertSuccess() throws Exception { mockMvc.perform(delete("/books/2") .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNotFound()); + .andExpect(status().isNoContent()); } @Test