Repository: Rencanakan-id/rencanakan-talent_pool-backend
Pull request #41: Aman 132/paging
Author: login: gnh374
Created: 2025-04-26T12:22:11Z | Merged: 2025-04-29T00:07:50Z

# Description  
add paging

# Ticket Issue 
[[Provide link to Jira]  ](https://a-man-ppl.atlassian.net/browse/AMAN-132)

# Changes Made  
nambahin paging
# Issue Type
- [ ] 🐛 Bug fix 
- [X] ⚙️ Refactor
- [ ] 💻 New feature 
- [ ] 📄 Documentation update
- [ ] ⚠️ Breaking changes
- [ ] 🔍 Testing

# Added/updated tests?
<!--We encourage you to keep the code coverage percentage at 80% and above-->
- [X] Yes
- [ ] No, and this is why: [please replace this line with details on why tests have not been included]

# Additional Notes  
[Include any extra information or considerations for reviewers, such as impacted areas of the codebase]

# (optional) What photo/gif best describes this PR or how it makes you feel?
[For the sake of our sanity and some fun, let's make code reviews more entertaining! 😆🎉] 


<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Enhanced talent search with filters for skills, preferred locations, and price range.
  - Added pagination support to talent search, including page number, page size, and total pages in responses.

- **Bug Fixes**
  - Improved handling of empty or non-matching filters to provide clearer responses.

- **Tests**
  - Added comprehensive integration and unit tests covering filtering and pagination scenarios.

- **Chores**
  - Updated security settings to allow unauthenticated access to contractor endpoint and adjusted CORS origins.
  - Disabled explicit server port override in development configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/src/main/java/rencanakan/id/talentpool/configs/SecurityConfiguration.java b/src/main/java/rencanakan/id/talentpool/configs/SecurityConfiguration.java
index 6009e7a5..e8981d3a 100644
--- a/src/main/java/rencanakan/id/talentpool/configs/SecurityConfiguration.java
+++ b/src/main/java/rencanakan/id/talentpool/configs/SecurityConfiguration.java
@@ -40,6 +40,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
                 .cors(cors -> cors.configurationSource(corsConfigurationSource()))
                 .authorizeHttpRequests(auth -> auth
                         .requestMatchers("/api/auth/**").permitAll()
+                        .requestMatchers("/api/users/contractor").permitAll()
                         .requestMatchers("/api/**").authenticated()
                         .requestMatchers("/actuator/**").permitAll()
                         .anyRequest().denyAll()
@@ -57,7 +58,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
     public CorsConfigurationSource corsConfigurationSource() {
         CorsConfiguration configuration = new CorsConfiguration();
 
-        configuration.setAllowedOrigins(List.of("http://localhost:5173", "https://rencanakanid-stg.netlify.app/"));
+        configuration.setAllowedOrigins(List.of("http://localhost:5173","http://localhost:8080", "https://rencanakanid-stg.netlify.app/"));
         configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH"));
         configuration.setAllowedHeaders(List.of("Authorization", "Content-Type"));
 
diff --git a/src/main/java/rencanakan/id/talentpool/controller/UserController.java b/src/main/java/rencanakan/id/talentpool/controller/UserController.java
index 0e642622..8f2b0183 100644
--- a/src/main/java/rencanakan/id/talentpool/controller/UserController.java
+++ b/src/main/java/rencanakan/id/talentpool/controller/UserController.java
@@ -1,14 +1,14 @@
 package rencanakan.id.talentpool.controller;
 
+
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.core.annotation.AuthenticationPrincipal;
 import org.springframework.web.bind.annotation.*;
 
 import jakarta.validation.Valid;
-import rencanakan.id.talentpool.dto.FilterTalentDTO;
-import rencanakan.id.talentpool.dto.UserRequestDTO;
-import rencanakan.id.talentpool.dto.UserResponseDTO;
-import rencanakan.id.talentpool.dto.WebResponse;
+import rencanakan.id.talentpool.dto.*;
 import rencanakan.id.talentpool.model.User;
 import rencanakan.id.talentpool.service.UserService;
 
@@ -86,14 +86,22 @@ public ResponseEntity<WebResponse<UserResponseDTO>> editUserById(
 
     @GetMapping("/contractor")
     public ResponseEntity<WebResponse<List<UserResponseDTO>>> getAllTalent(
-            @RequestParam(value = "name", required = false) String name
+            @RequestParam(value = "name", required = false) String name,
+            @RequestParam(value = "skills", required = false) List<String> skills,
+            @RequestParam(value = "preferred_locations", required = false) List<String> preferredLocations,
+            @RequestParam(value = "price_range", required = false) List<Double> priceRange,
+            @RequestParam(defaultValue = "0") int page,
+            @RequestParam(defaultValue = "10") Integer size
     ) {
-        FilterTalentDTO filter = FilterTalentDTO.builder().name(name).build();
-
-        List<UserResponseDTO> results = userService.filter(filter);
+        FilterTalentDTO filter = FilterTalentDTO.builder().name(name).skills(skills).priceRange(priceRange).preferredLocations(preferredLocations).build();
+        Pageable pageable = PageRequest.of(page, size);
+        UserResponseWithPagingDTO results = userService.filter(filter, pageable);
 
         WebResponse<List<UserResponseDTO>> response = WebResponse.<List<UserResponseDTO>>builder()
-                .data(results)
+                .data(results.getUsers())
+                .page(results.getPage())
+                .size(results.getSize())
+                .totalPages(results.getTotalPages())
                 .build();
 
         return ResponseEntity.ok(response);
diff --git a/src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java b/src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java
index 1a7ec3f4..65d18db2 100644
--- a/src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java
+++ b/src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java
@@ -1,12 +1,17 @@
 package rencanakan.id.talentpool.dto;
 
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
+import lombok.*;
+
+import java.util.List;
 
 @Builder
+@NoArgsConstructor
+@AllArgsConstructor
 @Getter
 @Setter
 public class FilterTalentDTO {
     String name;
+    List<String> skills;
+    List<String> preferredLocations;
+    List<Double> priceRange;
 }
diff --git a/src/main/java/rencanakan/id/talentpool/dto/UserResponseWithPagingDTO.java b/src/main/java/rencanakan/id/talentpool/dto/UserResponseWithPagingDTO.java
new file mode 100644
index 00000000..179e917b
--- /dev/null
+++ b/src/main/java/rencanakan/id/talentpool/dto/UserResponseWithPagingDTO.java
@@ -0,0 +1,17 @@
+package rencanakan.id.talentpool.dto;
+
+import lombok.*;
+
+import java.util.List;
+@NoArgsConstructor
+@Getter
+@Setter
+@Builder
+@AllArgsConstructor
+public class UserResponseWithPagingDTO {
+    private List<UserResponseDTO> users;
+    private int page;
+    private int size;
+    private int totalPages;
+
+}
diff --git a/src/main/java/rencanakan/id/talentpool/dto/WebResponse.java b/src/main/java/rencanakan/id/talentpool/dto/WebResponse.java
index d9127822..6f5c1c9e 100644
--- a/src/main/java/rencanakan/id/talentpool/dto/WebResponse.java
+++ b/src/main/java/rencanakan/id/talentpool/dto/WebResponse.java
@@ -10,6 +10,8 @@
 public class WebResponse <T> {
 
     private T data;
-
+    private int page;
+    private int size;
+    private int totalPages;
     private String errors;
 }
diff --git a/src/main/java/rencanakan/id/talentpool/service/UserService.java b/src/main/java/rencanakan/id/talentpool/service/UserService.java
index f138e4b4..d3c18724 100644
--- a/src/main/java/rencanakan/id/talentpool/service/UserService.java
+++ b/src/main/java/rencanakan/id/talentpool/service/UserService.java
@@ -1,15 +1,18 @@
 package rencanakan.id.talentpool.service;
 
+import org.springframework.data.domain.Pageable;
 import rencanakan.id.talentpool.dto.FilterTalentDTO;
 import rencanakan.id.talentpool.dto.UserRequestDTO;
 import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
 import rencanakan.id.talentpool.model.User;
 
+
 import java.util.List;
 
 public interface UserService {
     UserResponseDTO getById(String id);
     UserResponseDTO editById(String id, UserRequestDTO editedUser);
     User findByEmail(String email);
-    List<UserResponseDTO> filter(FilterTalentDTO filter);
+    UserResponseWithPagingDTO filter(FilterTalentDTO filter, Pageable page);
 }
diff --git a/src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java b/src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java
index 11bba871..717e7425 100644
--- a/src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java
+++ b/src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java
@@ -1,6 +1,10 @@
 package rencanakan.id.talentpool.service;
 
 import jakarta.persistence.EntityNotFoundException;
+import jakarta.persistence.criteria.Join;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.core.userdetails.UsernameNotFoundException;
@@ -9,10 +13,12 @@
 import rencanakan.id.talentpool.dto.FilterTalentDTO;
 import rencanakan.id.talentpool.dto.UserRequestDTO;
 import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
 import rencanakan.id.talentpool.mapper.DTOMapper;
 import rencanakan.id.talentpool.model.User;
 import rencanakan.id.talentpool.repository.UserRepository;
 
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
@@ -86,7 +92,7 @@ public User findByEmail(String email) {
     }
 
     @Override
-    public List<UserResponseDTO> filter(FilterTalentDTO filter) {
+    public UserResponseWithPagingDTO filter(FilterTalentDTO filter, Pageable page) {
         Specification<User> specification = (root, query, builder) -> {
             List<Predicate> predicates = new ArrayList<>();
 
@@ -104,17 +110,41 @@ public List<UserResponseDTO> filter(FilterTalentDTO filter) {
                 predicates.add(builder.or(firstNamePredicate, lastNamePredicate));
             }
 
+            if (Objects.nonNull(filter.getPreferredLocations()) && !filter.getPreferredLocations().isEmpty()) {
+
+                Predicate locationPredicate = root.get("currentLocation").in(filter.getPreferredLocations());
+
+                predicates.add(locationPredicate);
+            }
+
+            if (Objects.nonNull(filter.getSkills()) && !filter.getSkills().isEmpty()) {
+                Predicate skillsPredicate = root.get("skill").in(filter.getSkills());
+                predicates.add(skillsPredicate);
+            }
+
+            if (Objects.nonNull(filter.getPriceRange()) && filter.getPriceRange().size() == 2) {
+                Double minPrice = filter.getPriceRange().get(0);
+                Double maxPrice = filter.getPriceRange().get(1);
+
+                Predicate pricePredicate = builder.between(root.get("price"), minPrice, maxPrice);
+
+                predicates.add(pricePredicate);
+            }
+
+
             return builder.and(predicates.toArray(new Predicate[0]));
         };
 
-        List<User> users = userRepository.findAll(specification);
-        if(users.isEmpty()){
+        Page<User> userPage = userRepository.findAll(specification, page);
+        if(userPage.isEmpty()){
             throw  new EntityNotFoundException("No users found");
         }
 
-        return users.stream()
+        List<UserResponseDTO> userDTOs = userPage.getContent().stream()
                 .map(user -> DTOMapper.map(user, UserResponseDTO.class))
                 .collect(Collectors.toList());
+
+        return UserResponseWithPagingDTO.builder().users(userDTOs).page( userPage.getNumber()).size(userPage.getSize()).totalPages(userPage.getTotalPages()).build();
     }
 
 
diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties
index c63170ed..c220ad94 100644
--- a/src/main/resources/application-dev.properties
+++ b/src/main/resources/application-dev.properties
@@ -18,4 +18,4 @@ security.jwt.expiration-time=86400000
 management.endpoints.web.exposure.include=health,info,prometheus
 management.endpoint.prometheus.enabled=true
 management.metrics.export.prometheus.enabled=true
-
+#server.port = 8081
diff --git a/src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java b/src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java
new file mode 100644
index 00000000..200245aa
--- /dev/null
+++ b/src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java
@@ -0,0 +1,119 @@
+package rencanakan.id.talentpool.integration;
+
+import jakarta.persistence.EntityNotFoundException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.test.context.ActiveProfiles;
+import rencanakan.id.talentpool.dto.FilterTalentDTO;
+import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
+import rencanakan.id.talentpool.model.User;
+import rencanakan.id.talentpool.repository.UserRepository;
+import rencanakan.id.talentpool.service.UserService;
+import rencanakan.id.talentpool.service.UserServiceImpl;
+
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+@DataJpaTest
+@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
+@ActiveProfiles("test")
+class UserServiceIntegrationTest {
+
+    @Autowired
+    private UserRepository userRepository;
+    private UserService userService;
+    private  Pageable page;
+
+    @BeforeEach
+    void setup() {
+        userService = new UserServiceImpl(userRepository);
+        User user = User.builder()
+                .firstName("John")
+                .lastName("Doe")
+                .email("john.doe@example.com")
+                .password("SecurePass123!")
+                .phoneNumber("081234567890")
+                .nik("1234567890123456")
+                .currentLocation("Jakarta")
+                .preferredLocations(List.of("Jakarta", "Bandung","NY"))
+                .skill("Java")
+                .price(75)
+                .aboutMe("Full-stack developer with 5+ years experience")
+                .build();
+        userRepository.save(user);
+
+        page = PageRequest.of(0, 1);
+    }
+
+
+    @Test
+    void testFilter_SuccessfulMatch() {
+        FilterTalentDTO filter = FilterTalentDTO.builder().name("john").preferredLocations( List.of("Jakarta")).skills(List.of("Java")).priceRange(List.of(50.0, 100.0)).build();
+
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty());
+        assertEquals("John", result.getUsers().get(0).getFirstName()); // Case-insensitive [[7]]
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+
+    @Test
+    void testFilter_LocationMismatch() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, List.of("CA"), null, null);
+        assertThrows(EntityNotFoundException.class, () -> userService.filter(filter,page));
+    }
+
+    // Edge Test: Empty price range (ignored) [[6]]
+    @Test
+    void testFilter_EmptyPriceRange() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of());
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty()); // Price filter skipped
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+    // Edge Test: Exact price boundary [[4]]
+    @Test
+    void testFilter_ExactPriceBoundary() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of(75.0, 75.0));
+        UserResponseWithPagingDTO result = userService.filter(filter, page);
+        assertFalse(result.getUsers().isEmpty()); // Exact price match
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+    // Negative Test: Non-existent skill [[4]]
+    @Test
+    void testFilter_SkillMismatch() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, List.of("Python"), null);
+        assertThrows(EntityNotFoundException.class, () -> userService.filter(filter,page));
+    }
+    @Test
+    void testBlank() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, List.of(), List.of(), null);
+        UserResponseWithPagingDTO result = userService.filter(filter, page);
+        assertFalse(result.getUsers().isEmpty());
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+    // Edge Test: No filters (empty repository) [[8]]
+    @Test
+    void testFilter_NoFilters_EmptyRepo() {
+        userRepository.deleteAll(); // Clear seeded data
+        FilterTalentDTO filter = new FilterTalentDTO();
+        assertThrows(EntityNotFoundException.class, () -> userService.filter(filter,page));
+    }
+}
diff --git a/src/test/java/rencanakan/id/talentpool/unit/controller/UserControllerTest.java b/src/test/java/rencanakan/id/talentpool/unit/controller/UserControllerTest.java
index f794e87c..29d98146 100644
--- a/src/test/java/rencanakan/id/talentpool/unit/controller/UserControllerTest.java
+++ b/src/test/java/rencanakan/id/talentpool/unit/controller/UserControllerTest.java
@@ -17,6 +17,7 @@
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
+import org.springframework.data.domain.Pageable;
 import org.springframework.http.MediaType;
 import org.springframework.test.web.servlet.MockMvc;
 import org.springframework.test.web.servlet.setup.MockMvcBuilders;
@@ -30,6 +31,7 @@
 import rencanakan.id.talentpool.dto.FilterTalentDTO;
 import rencanakan.id.talentpool.dto.UserRequestDTO;
 import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
 import rencanakan.id.talentpool.model.User;
 import rencanakan.id.talentpool.service.UserService;
 
@@ -38,17 +40,17 @@ class UserControllerTest {
 
     @Mock
     private UserService userService;
-    
+
     @Mock
     private Validator validator;
 
     @InjectMocks
     private UserController userController;
-    
+
     private MockMvc mockMvc;
-    
+
     private ObjectMapper objectMapper;
-    
+
     private User testUser;
 
     @BeforeEach
@@ -56,13 +58,13 @@ void setUp() {
         testUser = new User();
         testUser.setId("user123");
         testUser.setEmail("john.doe@example.com");
-        
+
         mockMvc = MockMvcBuilders
             .standaloneSetup(userController)
                 .setControllerAdvice(new ErrorController())
             .setCustomArgumentResolvers(new PrincipalDetailsArgumentResolver(testUser))
             .build();
-            
+
         objectMapper = new ObjectMapper();
     }
 
@@ -115,7 +117,7 @@ private UserRequestDTO createUserRequestDTO() {
     @Nested
     @DisplayName("Get User Tests")
     class GetUserTests {
-        
+
         @Test
         @DisplayName("Should return user when user exists")
         void testGetUserById_Success() throws Exception {
@@ -161,7 +163,7 @@ void testGetUserById_NotFound() throws Exception {
         @DisplayName("Should return 401 when user is unauthorized for get by ID")
         void testGetUserById_Unauthorized() throws Exception {
             String userId = "user123";
-            
+
             // Set up mock with null user (unauthorized)
             mockMvc = MockMvcBuilders
                 .standaloneSetup(userController)
@@ -175,7 +177,7 @@ void testGetUserById_Unauthorized() throws Exception {
 
             verify(userService, never()).getById(any());
         }
-        
+
         @Test
         @DisplayName("Should return current user when using /me endpoint")
         void testGetCurrentUser_Success() throws Exception {
@@ -209,17 +211,17 @@ void testGetCurrentUser_Success() throws Exception {
 
             verify(userService, times(1)).getById(any());
         }
-        
+
         @Test
         @DisplayName("Should return 404 when user is not found")
         void testGetCurrentUser_NotFound() throws Exception {
             when(userService.getById(any())).thenReturn(null);
-            
+
             mockMvc.perform(get("/users/me")
                     .contentType(MediaType.APPLICATION_JSON))
                     .andExpect(status().isNotFound())
                     .andExpect(jsonPath("$.errors").value("User not found."));
-                    
+
             verify(userService, times(1)).getById(any());
         }
     }
@@ -227,7 +229,7 @@ void testGetCurrentUser_NotFound() throws Exception {
     @Nested
     @DisplayName("Update User Tests")
     class UpdateUserTests {
-        
+
         @Test
         @DisplayName("Should update user with valid data")
         void testUpdateUser_Success() throws Exception {
@@ -235,11 +237,11 @@ void testUpdateUser_Success() throws Exception {
             UserRequestDTO updatedUser = createUserRequestDTO();
             updatedUser.setFirstName("Jane");
             updatedUser.setLastName("Smith");
-            
+
             UserResponseDTO responseDTO = createUserResponseDTO();
             responseDTO.setFirstName("Jane");
             responseDTO.setLastName("Smith");
-            
+
             when(userService.editById(eq(userId), any(UserRequestDTO.class))).thenReturn(responseDTO);
 
             mockMvc.perform(put("/users/{id}", userId)
@@ -258,28 +260,28 @@ void testUpdateUser_Success() throws Exception {
         void testUpdateUser_UserNotFound() throws Exception {
             String userId = "nonexistent";
             UserRequestDTO updatedUser = createUserRequestDTO();
-            
+
             mockMvc.perform(put("/users/{id}", userId)
                     .contentType(MediaType.APPLICATION_JSON)
                     .content(objectMapper.writeValueAsString(updatedUser)))
                     .andExpect(status().isForbidden())
                     .andExpect(jsonPath("$.errors").value("You are not authorized to edit this user."));
-            
+
             verify(userService, never()).editById(eq(userId), any(UserRequestDTO.class));
         }
-        
+
         @Test
         @DisplayName("Should return forbidden when updating another user's profile")
         void testUpdateUser_Forbidden() throws Exception {
             String otherUserId = "other123";
             UserRequestDTO updatedUser = createUserRequestDTO();
-            
+
             mockMvc.perform(put("/users/{id}", otherUserId)
                     .contentType(MediaType.APPLICATION_JSON)
                     .content(objectMapper.writeValueAsString(updatedUser)))
                     .andExpect(status().isForbidden())
                     .andExpect(jsonPath("$.errors").value("You are not authorized to edit this user."));
-            
+
             verify(userService, never()).editById(eq(otherUserId), any(UserRequestDTO.class));
         }
     }
@@ -290,7 +292,7 @@ void getAllTalent_withNameFilter_returnsFilteredUsers() throws Exception {
 
             UserResponseDTO userDto = UserResponseDTO.builder().firstName("John").lastName("Doe").build();
 
-            when(userService.filter(any(FilterTalentDTO.class))).thenReturn(List.of(userDto));
+            when(userService.filter(any(FilterTalentDTO.class), any(Pageable.class))).thenReturn(UserResponseWithPagingDTO.builder().users(List.of(userDto)).build() );
 
             mockMvc.perform(get("/users/contractor")
                             .param("name", "john"))
@@ -301,7 +303,7 @@ void getAllTalent_withNameFilter_returnsFilteredUsers() throws Exception {
 
         @Test
         void getAllTalent_withNonMatchingName_throwsEntityNotFoundException() throws Exception {
-              when(userService.filter(any(FilterTalentDTO.class)))
+              when(userService.filter(any(FilterTalentDTO.class), any(Pageable.class)))
                     .thenThrow(new EntityNotFoundException("No users found"));
             mockMvc.perform(get("/users/contractor")
                             .param("name", "nonexistent"))
@@ -317,7 +319,7 @@ void getAllTalent_withNullName_returnsAllUsers() throws Exception {
 
             List<UserResponseDTO> allUsers = List.of(user1, user2);
 
-            when(userService.filter(any(FilterTalentDTO.class))).thenReturn(allUsers);
+            when(userService.filter(any(FilterTalentDTO.class), any(Pageable.class))).thenReturn(UserResponseWithPagingDTO.builder().users(allUsers).build());
 
             mockMvc.perform(get("/users/contractor"))
                     .andExpect(status().isOk())
diff --git a/src/test/java/rencanakan/id/talentpool/unit/service/UserServiceTest.java b/src/test/java/rencanakan/id/talentpool/unit/service/UserServiceTest.java
index 3a46fb45..9dc22768 100644
--- a/src/test/java/rencanakan/id/talentpool/unit/service/UserServiceTest.java
+++ b/src/test/java/rencanakan/id/talentpool/unit/service/UserServiceTest.java
@@ -1,7 +1,9 @@
 package rencanakan.id.talentpool.unit.service;
 
 import jakarta.persistence.EntityNotFoundException;
+
 import jakarta.validation.Validator;
+import org.hibernate.query.Page;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Nested;
@@ -9,6 +11,9 @@
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.*;
 import org.mockito.junit.jupiter.MockitoExtension;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.security.core.userdetails.UsernameNotFoundException;
 
@@ -16,15 +21,13 @@
 import static org.mockito.Mockito.*;
 import static org.junit.jupiter.api.Assertions.*;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
+import java.util.*;
 import java.lang.reflect.Field;
 
 import rencanakan.id.talentpool.dto.FilterTalentDTO;
 import rencanakan.id.talentpool.dto.UserRequestDTO;
 import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
 import rencanakan.id.talentpool.mapper.DTOMapper;
 import rencanakan.id.talentpool.model.User;
 import rencanakan.id.talentpool.repository.UserRepository;
@@ -33,6 +36,7 @@
 @ExtendWith(MockitoExtension.class)
 class UserServiceTest {
 
+
     @Mock
     private UserRepository userRepository;
 
@@ -44,6 +48,8 @@ class UserServiceTest {
 
     private String testUserId = "user123";
     private User testUser;
+    Pageable page ; // page = 0, size = 1
+
 
     @BeforeEach
     void setUp() {
@@ -54,8 +60,20 @@ void setUp() {
         testUser.setEmail("john.doe@example.com");
         testUser.setPassword("password123");
         testUser.setNik("1234567891011121");
+
+        page = PageRequest.of(0, 1);
+
     }
 
+    private User mockUser(String firstName) {
+        User user = new User();
+        user.setFirstName(firstName);
+        return user;
+    }
+
+
+
+
     @Nested
     class ReadUserTests {
         @Test
@@ -286,15 +304,16 @@ void loadUserByUsername_WithNonExistentEmail_ThrowsUsernameNotFoundException() {
     @Nested
     class FilterTalentTest{
         @Test
-        void filter_withValidName_returnsMatchingUsers() {
-            FilterTalentDTO filter = FilterTalentDTO.builder().name("john").build();
+        void filter_withValidData_returnsMatchingUsers() {
+            FilterTalentDTO filter = FilterTalentDTO.builder().name("john").preferredLocations( Arrays.asList("Jakarta")).priceRange(Arrays.asList(0.00,200000.00)).skills(Arrays.asList("Java")).build();
 
             User user = new User();
             user.setFirstName("John");
             user.setLastName("Doe");
 
-            Mockito.when(userRepository.findAll(any(Specification.class)))
-                    .thenReturn(List.of(user));
+            when(userRepository.findAll(any(Specification.class), any(Pageable.class)))
+                    .thenReturn(new PageImpl<>(List.of(user)));
+
 
             try (MockedStatic<DTOMapper> mockedMapper = Mockito.mockStatic(DTOMapper.class)) {
                 UserResponseDTO dto = new UserResponseDTO();
@@ -303,10 +322,113 @@ void filter_withValidName_returnsMatchingUsers() {
 
                 mockedMapper.when(() -> DTOMapper.map(user, UserResponseDTO.class)).thenReturn(dto);
 
-                List<UserResponseDTO> result = userService.filter(filter);
 
-                Assertions.assertEquals(1, result.size());
-                Assertions.assertEquals("John", result.get(0).getFirstName());
+                UserResponseWithPagingDTO result = userService.filter(filter, page);
+
+                Assertions.assertEquals(1, result.getUsers().size());
+                Assertions.assertEquals("John", result.getUsers().get(0).getFirstName());
+            }
+        }
+
+        @Test
+        void filter_withOnlyName_shouldReturnMatchingUsers() {
+            FilterTalentDTO filter = FilterTalentDTO.builder().name("doe").build();
+
+            User user = mockUser("Doe");
+
+            when(userRepository.findAll(any(Specification.class), any(Pageable.class)))
+                    .thenReturn(new PageImpl<>(List.of(user)));
+
+
+            try (MockedStatic<DTOMapper> mockedMapper = Mockito.mockStatic(DTOMapper.class)) {
+                mockedMapper.when(() -> DTOMapper.map(user, UserResponseDTO.class)).thenReturn(UserResponseDTO.builder().firstName("Doe").build());
+
+                UserResponseWithPagingDTO result = userService.filter(filter, page);
+
+                Assertions.assertEquals(1, result.getUsers().size());
+            }
+        }
+
+        @Test
+        void filter_withOnlyPreferredLocations_shouldReturnMatchingUsers() {
+            FilterTalentDTO filter = FilterTalentDTO.builder()
+                    .preferredLocations(List.of("Bandung"))
+                    .build();
+
+            User user = mockUser("A");
+
+            when(userRepository.findAll(any(Specification.class), any(Pageable.class)))
+                    .thenReturn(new PageImpl<>(List.of(user)));
+
+            try (MockedStatic<DTOMapper> mockedMapper = Mockito.mockStatic(DTOMapper.class)) {
+                mockedMapper.when(() -> DTOMapper.map(user, UserResponseDTO.class)).thenReturn(UserResponseDTO.builder().preferredLocations(Arrays.asList("Bandung")).build());
+
+                UserResponseWithPagingDTO result = userService.filter(filter, page);
+
+
+                Assertions.assertEquals(1, result.getUsers().size());
+            }
+        }
+        @Test
+        void filter_withOnlySkills_shouldReturnMatchingUsers() {
+            FilterTalentDTO filter = FilterTalentDTO.builder()
+                    .skills(List.of("React"))
+                    .build();
+
+            User user = mockUser("B");
+
+            when(userRepository.findAll(any(Specification.class), any(Pageable.class)))
+                    .thenReturn(new PageImpl<>(List.of(user)));
+
+            try (MockedStatic<DTOMapper> mockedMapper = Mockito.mockStatic(DTOMapper.class)) {
+                mockedMapper.when(() -> DTOMapper.map(user, UserResponseDTO.class)).thenReturn(UserResponseDTO.builder().skill("React").build());
+
+                UserResponseWithPagingDTO result = userService.filter(filter, page);
+
+
+                Assertions.assertEquals(1, result.getUsers().size());
+            }
+        }
+
+        @Test
+        void filter_withOnlyPriceRange_shouldReturnMatchingUsers() {
+            FilterTalentDTO filter = FilterTalentDTO.builder()
+                    .priceRange(List.of(100.0, 200.0))
+                    .build();
+
+            User user = mockUser("C");
+
+            when(userRepository.findAll(any(Specification.class), any(Pageable.class)))
+                    .thenReturn(new PageImpl<>(List.of(user)));
+
+            try (MockedStatic<DTOMapper> mockedMapper = Mockito.mockStatic(DTOMapper.class)) {
+                mockedMapper.when(() -> DTOMapper.map(user, UserResponseDTO.class)).thenReturn(UserResponseDTO.builder().price(150).build());
+
+                UserResponseWithPagingDTO result = userService.filter(filter, page);
+
+
+                Assertions.assertEquals(1, result.getUsers().size());
+            }
+        }
+
+        @Test
+        void filter_withInvalidPriceRange_shouldIgnoreIt() {
+            FilterTalentDTO filter = FilterTalentDTO.builder()
+                    .priceRange(List.of(100.0)) // kurang dari dua
+                    .build();
+
+            User user = mockUser("D");
+
+            when(userRepository.findAll(any(Specification.class), any(Pageable.class)))
+                    .thenReturn(new PageImpl<>(List.of(user)));
+
+            try (MockedStatic<DTOMapper> mockedMapper = Mockito.mockStatic(DTOMapper.class)) {
+                mockedMapper.when(() -> DTOMapper.map(user, UserResponseDTO.class)).thenReturn(UserResponseDTO.builder().firstName("D").build());
+
+                UserResponseWithPagingDTO result = userService.filter(filter, page);
+
+
+                Assertions.assertEquals(1, result.getUsers().size());
             }
         }
 
@@ -315,13 +437,13 @@ void filter_withValidName_returnsMatchingUsers() {
         void filter_withNonMatchingName_returnsEmptyList() {
             FilterTalentDTO filter = FilterTalentDTO.builder().name("nonexistent").build();
 
-            Mockito.when(userRepository.findAll(any(Specification.class)))
-                    .thenReturn(Collections.emptyList());
+            when(userRepository.findAll(any(Specification.class), any(Pageable.class)))
+                    .thenReturn(new PageImpl<>(Collections.emptyList()));
 
 
             EntityNotFoundException thrown = Assertions.assertThrows(
                     EntityNotFoundException.class,
-                    () -> userService.filter(filter),
+                    () -> userService.filter(filter, page),
                     "Expected filter() to throw, but it didn't"
             );
 
@@ -342,8 +464,8 @@ void filter_withNullName_returnsAllUsers() {
 
             List<User> allUsers = List.of(user1, user2);
 
-            Mockito.when(userRepository.findAll(any(Specification.class)))
-                    .thenReturn(allUsers);
+            when(userRepository.findAll(any(Specification.class), any(Pageable.class)))
+                    .thenReturn(new PageImpl<>(allUsers));
 
             try (MockedStatic<DTOMapper> mockedMapper = Mockito.mockStatic(DTOMapper.class)) {
                 mockedMapper.when(() -> DTOMapper.map(eq(user1), eq(UserResponseDTO.class)))
@@ -352,12 +474,20 @@ void filter_withNullName_returnsAllUsers() {
                 mockedMapper.when(() -> DTOMapper.map(eq(user2), eq(UserResponseDTO.class)))
                         .thenReturn(UserResponseDTO.builder().firstName("Bob").lastName("Johnson").build());
 
-                List<UserResponseDTO> result = userService.filter(filter);
+                UserResponseWithPagingDTO result = userService.filter(filter, page);
+
 
-                Assertions.assertEquals(2, result.size());
-                Assertions.assertEquals("Alice", result.get(0).getFirstName());
-                Assertions.assertEquals("Bob", result.get(1).getFirstName());
+                Assertions.assertEquals(2, result.getUsers().size());
+                Assertions.assertEquals("Alice", result.getUsers().get(0).getFirstName());
+                Assertions.assertEquals("Bob", result.getUsers().get(1).getFirstName());
             }
         }
+
     }
+
+
+
+
+
+
 }


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 6**

<details>
<summary>🧹 Nitpick comments (19)</summary><blockquote>

<details>
<summary>src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java (1)</summary><blockquote>

`14-16`: **Well-structured additional filter fields.**

The new filter fields (skills, preferredLocations, priceRange) enhance the filtering capabilities and are appropriately typed as collection types.

Consider documenting the expected format for the priceRange list (e.g., is it [min, max] or something else?) to make the API more clear to consumers.



```diff
 public class FilterTalentDTO {
     String name;
     List<String> skills;
     List<String> preferredLocations;
+    // Expected format: [minPrice, maxPrice]
     List<Double> priceRange;
 }
```

</blockquote></details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/controller/UserController.java (1)</summary><blockquote>

`96-98`: **Consider adding validation for price range**

The price range parameter might need validation to ensure proper format (e.g., exactly two values representing min and max).

```diff
-        FilterTalentDTO filter = FilterTalentDTO.builder().name(name).skills(skills).priceRange(priceRange).preferredLocations(preferredLocations).build();
+        // Validate price range format if provided
+        if (priceRange != null && priceRange.size() != 2) {
+            return ResponseEntity.badRequest().body(WebResponse.<List<UserResponseDTO>>builder()
+                    .errors("Price range must contain exactly two values: min and max")
+                    .build());
+        }
+        FilterTalentDTO filter = FilterTalentDTO.builder().name(name).skills(skills).priceRange(priceRange).preferredLocations(preferredLocations).build();
```

</blockquote></details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java (4)</summary><blockquote>

`113-119`: **Consider using distinct query for location filtering**

When filtering by preferredLocations, the current join may lead to duplicate users in the result if a user has multiple matching locations. Consider adding a distinct clause to the query.

```diff
            if (Objects.nonNull(filter.getPreferredLocations()) && !filter.getPreferredLocations().isEmpty()) {
                Join<User, String> locationJoin = root.join("preferredLocations");

                Predicate locationPredicate = locationJoin.in(filter.getPreferredLocations());

                predicates.add(locationPredicate);
+               
+               // Ensure distinct results when joining with a collection
+               query.distinct(true);
            }
```

---

`126-133`: **Improve validation for price range**

The priceRange validation is good, but you could add further validation to ensure the min price is less than or equal to the max price.

```diff
            if (Objects.nonNull(filter.getPriceRange()) && filter.getPriceRange().size() == 2) {
                Double minPrice = filter.getPriceRange().get(0);
                Double maxPrice = filter.getPriceRange().get(1);

+               // Ensure minPrice <= maxPrice
+               if (minPrice > maxPrice) {
+                   Double temp = minPrice;
+                   minPrice = maxPrice;
+                   maxPrice = temp;
+               }
+               
                Predicate pricePredicate = builder.between(root.get("price"), minPrice, maxPrice);

                predicates.add(pricePredicate);
            }
```

---

`139-142`: **Consider a more specific exception for empty results**

Using `EntityNotFoundException` for empty search results may not be the most semantic choice as it's typically used when a specific entity can't be found by ID.

```diff
        Page<User> userPage = userRepository.findAll(specification, page);
        if(userPage.isEmpty()){
-            throw  new EntityNotFoundException("No users found");
+            throw new NoResultException("No users match the specified criteria");
        }
```

---

`148-148`: **Improve readability with line breaks or method extraction**

The builder pattern usage is correct but this line is quite long. Consider breaking it up for better readability.

```diff
-        return UserResponseWithPagingDTO.builder().users(userDTOs).page( userPage.getNumber()).size(userPage.getSize()).totalPages(userPage.getTotalPages()).build();
+        return UserResponseWithPagingDTO.builder()
+                .users(userDTOs)
+                .page(userPage.getNumber())
+                .size(userPage.getSize())
+                .totalPages(userPage.getTotalPages())
+                .build();
```

</blockquote></details>
<details>
<summary>src/test/java/rencanakan/id/talentpool/unit/service/UserServiceTest.java (1)</summary><blockquote>

`307-370`: **Consider testing pagination metadata**

While your tests verify the content of the paginated results, they don't explicitly verify the pagination metadata (page, size, totalPages). Consider adding assertions for these values.

```diff
                UserResponseWithPagingDTO result = userService.filter(filter, page);

                Assertions.assertEquals(1, result.getUsers().size());
+               // Verify pagination metadata
+               Assertions.assertEquals(0, result.getPage());
+               Assertions.assertEquals(1, result.getSize());
+               Assertions.assertEquals(1, result.getTotalPages());
            }
```

</blockquote></details>
<details>
<summary>src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java (12)</summary><blockquote>

`33-33`: **Remove extra whitespace**

There's an extra space in the field declaration.

```diff
- private  Pageable page;
+ private Pageable page;
```

---

`58-58`: **Consistent DTO creation pattern**

The test uses both builder pattern and constructor for FilterTalentDTO across different test methods. Standardizing on one approach improves code consistency.

Use the builder pattern consistently across all tests:

```diff
- FilterTalentDTO filter = FilterTalentDTO.builder().name("john").preferredLocations( List.of("NY")).skills(List.of("Java")).priceRange(List.of(50.0, 100.0)).build();
+ FilterTalentDTO filter = FilterTalentDTO.builder()
+     .name("john")
+     .preferredLocations(List.of("NY"))
+     .skills(List.of("Java"))
+     .priceRange(List.of(50.0, 100.0))
+     .build();
```

---

`71-71`: **Consistent DTO creation pattern**

Use builder pattern consistently across tests.

```diff
- FilterTalentDTO filter = new FilterTalentDTO(null, List.of("CA"), null, null);
+ FilterTalentDTO filter = FilterTalentDTO.builder()
+     .preferredLocations(List.of("CA"))
+     .build();
```

---

`75-75`: **Remove code markers in comments**

Comments contain unexplained markers like [[6]] which should be removed or explained.

```diff
- // Edge Test: Empty price range (ignored) [[6]]
+ // Edge Test: Empty price range (ignored)
```

---

`78-78`: **Consistent DTO creation pattern**

Use builder pattern consistently across tests.

```diff
- FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of());
+ FilterTalentDTO filter = FilterTalentDTO.builder()
+     .priceRange(List.of())
+     .build();
```

---

`86-86`: **Remove code markers in comments**

Comments contain unexplained markers like [[4]] which should be removed or explained.

```diff
- // Edge Test: Exact price boundary [[4]]
+ // Edge Test: Exact price boundary
```

---

`89-89`: **Consistent DTO creation pattern**

Use builder pattern consistently across tests.

```diff
- FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of(75.0, 75.0));
+ FilterTalentDTO filter = FilterTalentDTO.builder()
+     .priceRange(List.of(75.0, 75.0))
+     .build();
```

---

`97-97`: **Remove code markers in comments**

Comments contain unexplained markers like [[4]] which should be removed or explained.

```diff
- // Negative Test: Non-existent skill [[4]]
+ // Negative Test: Non-existent skill
```

---

`100-100`: **Consistent DTO creation pattern**

Use builder pattern consistently across tests.

```diff
- FilterTalentDTO filter = new FilterTalentDTO(null, null, List.of("Python"), null);
+ FilterTalentDTO filter = FilterTalentDTO.builder()
+     .skills(List.of("Python"))
+     .build();
```

---

`111-111`: **Remove code markers in comments**

Comments contain unexplained markers like [[8]] which should be removed or explained.

```diff
- // Edge Test: No filters (empty repository) [[8]]
+ // Edge Test: No filters (empty repository)
```

---

`115-115`: **Consistent DTO creation pattern**

Use builder pattern consistently across tests.

```diff
- FilterTalentDTO filter = new FilterTalentDTO();
+ FilterTalentDTO filter = FilterTalentDTO.builder().build();
```

---

`28-118`: **Add test for multi-page results**

The current tests only check pagination with a single page of results. Consider adding a test case with multiple users and multiple pages to validate pagination behavior more comprehensively.

Add a test like:

```java
@Test
void testFilter_MultiplePages() {
    // Add more users to have multiple pages
    for (int i = 0; i < 5; i++) {
        User user = User.builder()
                .firstName("Dev" + i)
                .lastName("User")
                .email("dev" + i + "@example.com")
                .password("SecurePass123!")
                .phoneNumber("08123456789" + i)
                .nik("123456789012345" + i)
                .preferredLocations(List.of("Jakarta"))
                .skill("Java")
                .price(75)
                .aboutMe("Developer")
                .build();
        userRepository.save(user);
    }
    
    // Set page size to 2 to have multiple pages
    Pageable multiPageRequest = PageRequest.of(0, 2);
    FilterTalentDTO filter = FilterTalentDTO.builder().build();
    
    UserResponseWithPagingDTO result = userService.filter(filter, multiPageRequest);
    
    assertFalse(result.getUsers().isEmpty());
    assertEquals(2, result.getUsers().size(), "Should return 2 users per page");
    assertEquals(0, result.getPage(), "Page number should be 0");
    assertEquals(2, result.getSize(), "Page size should be 2");
    assertEquals(3, result.getTotalPages(), "Total pages should be 3");
    
    // Test second page
    Pageable secondPage = PageRequest.of(1, 2);
    result = userService.filter(filter, secondPage);
    
    assertEquals(1, result.getPage(), "Page number should be 1");
    assertEquals(2, result.getUsers().size(), "Should return 2 users on second page");
}
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0e4b2c5d61e02874ca0144fdfda640e9dafd7a37 and 9cb9811e8ed6b6f4e741540abae13f5b19a7df25.

</details>

<details>
<summary>📒 Files selected for processing (9)</summary>

* `src/main/java/rencanakan/id/talentpool/controller/UserController.java` (2 hunks)
* `src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java` (1 hunks)
* `src/main/java/rencanakan/id/talentpool/dto/UserResponseWithPagingDTO.java` (1 hunks)
* `src/main/java/rencanakan/id/talentpool/dto/WebResponse.java` (1 hunks)
* `src/main/java/rencanakan/id/talentpool/service/UserService.java` (1 hunks)
* `src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java` (4 hunks)
* `src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java` (1 hunks)
* `src/test/java/rencanakan/id/talentpool/unit/controller/UserControllerTest.java` (11 hunks)
* `src/test/java/rencanakan/id/talentpool/unit/service/UserServiceTest.java` (9 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (2)</summary>

<details>
<summary>src/main/java/rencanakan/id/talentpool/dto/UserResponseWithPagingDTO.java (2)</summary><blockquote>

<details>
<summary>src/main/java/rencanakan/id/talentpool/dto/WebResponse.java (1)</summary>

* `Getter` (5-17)

</details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java (1)</summary>

* `Builder` (7-17)

</details>

</blockquote></details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java (1)</summary><blockquote>

<details>
<summary>src/main/java/rencanakan/id/talentpool/mapper/DTOMapper.java (1)</summary>

* `DTOMapper` (5-45)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (2)</summary>

* GitHub Check: Test and Analysis
* GitHub Check: Analysis

</details>

<details>
<summary>🔇 Additional comments (12)</summary><blockquote>

<details>
<summary>src/main/java/rencanakan/id/talentpool/dto/WebResponse.java (1)</summary>

`13-15`: **Good addition of pagination fields!**

The addition of pagination metadata fields (page, size, totalPages) to the WebResponse class provides important information for clients consuming paginated APIs. This aligns with RESTful API best practices for paginated resources.

</details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/service/UserService.java (2)</summary>

`3-7`: **LGTM: Appropriate imports added for pagination.**

The new imports correctly support the pagination functionality being added to the service interface.

---

`17-17`: **Well-structured method signature update.**

The filter method signature has been appropriately updated to accept a Pageable parameter and return a UserResponseWithPagingDTO, which aligns with Spring's pagination approach.

</details>
<details>
<summary>src/test/java/rencanakan/id/talentpool/unit/controller/UserControllerTest.java (2)</summary>

`20-20`: **LGTM: Appropriate imports added for pagination testing.**

The new imports correctly support testing the pagination functionality in the controller.



Also applies to: 34-34

---

`300-301`: <details>
<summary>✅ Verification successful</summary>

**Response JSON structure might not match expectations.**

The current assertions expect properties at "$.data[0].firstName", but if the WebResponse is now wrapping a UserResponseWithPagingDTO (which contains a list of users), the JSON structure might be different. Verify the actual JSON structure and update assertions accordingly.


Run the following script to analyze the controller method implementation:




Also applies to: 326-327

---

🏁 Script executed:

```shell
#!/bin/bash
# Description: Check how the UserController constructs the response for /users/contractor

rg -A 15 "contractor" --type java src/main/java/rencanakan/id/talentpool/controller/
```

Length of output: 2268

---



</details>

**Assertions match actual JSON structure**  
The `UserController` builds a `WebResponse<List<UserResponseDTO>>` and populates `.data` with `results.getUsers()`, which is a list of user DTOs. The JSON produced still has a top-level `data` array of user objects, so the existing assertions on `$.data[0].firstName` and `$.data[0].lastName` are correct. No changes required.

</details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java (2)</summary>

`3-5`: **LGTM: Updated imports for new filter fields.**

The imports have been appropriately updated to support the new filter fields.

---

`8-9`: **LGTM: Added constructors for improved flexibility.**

Adding @NoArgsConstructor and @AllArgsConstructor annotations provides more flexibility for creating instances of this DTO.

</details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/controller/UserController.java (2)</summary>

`89-95`: **LGTM: User filter parameters well implemented**

The implementation of request parameters is clean and follows Spring best practices. Good use of `@RequestParam` with appropriate `required` flags and default values for pagination parameters.

---

`101-105`: **LGTM: Pagination metadata properly included**

The pagination metadata is correctly included in the response. Well done.

</details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/dto/UserResponseWithPagingDTO.java (1)</summary>

`1-17`: **LGTM: Well-structured DTO for pagination**

This DTO is well-designed for representing paginated user data. The use of Lombok annotations reduces boilerplate code and the class contains all necessary pagination metadata fields.

</details>
<details>
<summary>src/test/java/rencanakan/id/talentpool/unit/service/UserServiceTest.java (2)</summary>

`68-72`: **Good refactoring with helper method**

The `mockUser` helper method is a nice refactoring that reduces code duplication in your tests.

---

`415-432`: **Good test for invalid price range scenario**

This test correctly verifies that the service handles invalid price range input appropriately by ignoring it.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-26T12:25:11Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 2**

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>src/main/java/rencanakan/id/talentpool/configs/SecurityConfiguration.java (1)</summary><blockquote>

`61-61`: **CORS configuration updated but contains a potential issue with trailing slash.**

The CORS configuration has been appropriately updated to include the new development environment on port 8080. However, there's a trailing slash in the staging URL that could cause CORS issues.

```diff
-configuration.setAllowedOrigins(List.of("http://localhost:5173","http://localhost:8080", "https://rencanakanid-stg.netlify.app/"));
+configuration.setAllowedOrigins(List.of("http://localhost:5173", "http://localhost:8080", "https://rencanakanid-stg.netlify.app"));
```

</blockquote></details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java (2)</summary><blockquote>

`4-5`: **Remove unused import**

The `jakarta.persistence.criteria.Join` import is not being used in the implementation. 


```diff
-import jakarta.persistence.criteria.Join;
```

---

`147-147`: **Improve builder pattern readability**

The builder pattern usage is correct but cramped into a single line. Consider breaking it into multiple lines for better readability and maintainability.


```diff
-return UserResponseWithPagingDTO.builder().users(userDTOs).page(userPage.getNumber()).size(userPage.getSize()).totalPages(userPage.getTotalPages()).build();
+return UserResponseWithPagingDTO.builder()
+        .users(userDTOs)
+        .page(userPage.getNumber())
+        .size(userPage.getSize())
+        .totalPages(userPage.getTotalPages())
+        .build();
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 9cb9811e8ed6b6f4e741540abae13f5b19a7df25 and 7f4019bf074bf819f5d44fce089f88ab46da49b8.

</details>

<details>
<summary>📒 Files selected for processing (4)</summary>

* `src/main/java/rencanakan/id/talentpool/configs/SecurityConfiguration.java` (2 hunks)
* `src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java` (4 hunks)
* `src/main/resources/application-dev.properties` (1 hunks)
* `src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* src/main/resources/application-dev.properties

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (1)</summary>

<details>
<summary>src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java (1)</summary><blockquote>

<details>
<summary>src/main/java/rencanakan/id/talentpool/mapper/DTOMapper.java (1)</summary>

* `DTOMapper` (5-45)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (1)</summary>

* GitHub Check: Test and Analysis

</details>

<details>
<summary>🔇 Additional comments (3)</summary><blockquote>

<details>
<summary>src/main/java/rencanakan/id/talentpool/configs/SecurityConfiguration.java (1)</summary>

`43-43`: **Security configuration appropriately updated for new paging feature.**

The addition of this line correctly allows unauthenticated access to the contractor endpoint, which aligns with the PR's objective of adding paging functionality for talent filtering.

</details>
<details>
<summary>src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java (2)</summary>

`95-95`: **Method signature change for pagination support looks good**

The method signature has been appropriately updated to accept a Pageable parameter and return a UserResponseWithPagingDTO, aligning with the pagination requirements.

---

`138-141`: **Pagination query and empty check look good**

The repository query has been correctly updated to support pagination with the `findAll(specification, page)` method, and the empty check ensures users get a clear error message when no results are found.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-28T12:54:55Z

Review comments:
diff_hunk: @@ -290,7 +292,7 @@ void getAllTalent_withNameFilter_returnsFilteredUsers() throws Exception {
 
             UserResponseDTO userDto = UserResponseDTO.builder().firstName("John").lastName("Doe").build();
 
-            when(userService.filter(any(FilterTalentDTO.class))).thenReturn(List.of(userDto));
+            when(userService.filter(any(FilterTalentDTO.class), any(Pageable.class))).thenReturn(UserResponseWithPagingDTO.builder().users(List.of(userDto)).build() );
path: src/test/java/rencanakan/id/talentpool/unit/controller/UserControllerTest.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Tests should validate pagination metadata.**

While the tests have been updated to use the new UserResponseWithPagingDTO, they don't verify the pagination metadata (page, size, totalPages) in the response. Consider adding assertions for these fields to ensure complete test coverage.


For example, update the mock and assertions:

```diff
-when(userService.filter(any(FilterTalentDTO.class), any(Pageable.class))).thenReturn(UserResponseWithPagingDTO.builder().users(List.of(userDto)).build() );
+when(userService.filter(any(FilterTalentDTO.class), any(Pageable.class))).thenReturn(
+    UserResponseWithPagingDTO.builder()
+        .users(List.of(userDto))
+        .page(0)
+        .size(10)
+        .totalPages(1)
+        .build()
+);

// Then add these assertions after the existing ones
+.andExpect(jsonPath("$.page").value(0))
+.andExpect(jsonPath("$.size").value(10))
+.andExpect(jsonPath("$.totalPages").value(1));
```


Also applies to: 322-322

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-26T12:25:10Z
author_association: NONE
diff_hunk: @@ -0,0 +1,118 @@
+package rencanakan.id.talentpool.integration;
+
+import jakarta.persistence.EntityNotFoundException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.test.context.ActiveProfiles;
+import rencanakan.id.talentpool.dto.FilterTalentDTO;
+import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
+import rencanakan.id.talentpool.model.User;
+import rencanakan.id.talentpool.repository.UserRepository;
+import rencanakan.id.talentpool.service.UserService;
+import rencanakan.id.talentpool.service.UserServiceImpl;
+
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+@DataJpaTest
+@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
+@ActiveProfiles("test")
+class UserServiceIntegrationTest {
+
+    @Autowired
+    private UserRepository userRepository;
+    private UserService userService;
+    private  Pageable page;
+
+    @BeforeEach
+    void setup() {
+        userService = new UserServiceImpl(userRepository);
+        User user = User.builder()
+                .firstName("John")
+                .lastName("Doe")
+                .email("john.doe@example.com")
+                .password("SecurePass123!")
+                .phoneNumber("081234567890")
+                .nik("1234567890123456")
+                .preferredLocations(List.of("Jakarta", "Bandung","NY"))
+                .skill("Java")
+                .price(75)
+                .aboutMe("Full-stack developer with 5+ years experience")
+                .build();
+        userRepository.save(user);
+
+        page = PageRequest.of(0, 1);
+    }
+
+
+    @Test
+    void testFilter_SuccessfulMatch() {
+        FilterTalentDTO filter = FilterTalentDTO.builder().name("john").preferredLocations( List.of("NY")).skills(List.of("Java")).priceRange(List.of(50.0, 100.0)).build();
+
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty());
+        assertEquals("John", result.getUsers().get(0).getFirstName()); // Case-insensitive [[7]]
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+
+    @Test
+    void testFilter_LocationMismatch() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, List.of("CA"), null, null);
+        assertThrows(EntityNotFoundException.class, () -> userService.filter(filter,page));
+    }
+
+    // Edge Test: Empty price range (ignored) [[6]]
+    @Test
+    void testFilter_EmptyPriceRange() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of());
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty()); // Price filter skipped
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+    // Edge Test: Exact price boundary [[4]]
+    @Test
+    void testFilter_ExactPriceBoundary() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of(75.0, 75.0));
+        UserResponseWithPagingDTO result = userService.filter(filter, page);
+        assertFalse(result.getUsers().isEmpty()); // Exact price match
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
path: src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Use JUnit's assertEquals with correct parameter order**

The assertions have parameters in the wrong order (expected should come first).

```diff
- assertEquals(result.getPage(),0);
- assertEquals(result.getSize(), 1);
- assertEquals(result.getTotalPages(), 1);
+ assertEquals(0, result.getPage(), "Page number should be 0");
+ assertEquals(1, result.getSize(), "Page size should be 1");
+ assertEquals(1, result.getTotalPages(), "Total pages should be 1");
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-26T12:25:10Z
author_association: NONE
diff_hunk: @@ -0,0 +1,118 @@
+package rencanakan.id.talentpool.integration;
+
+import jakarta.persistence.EntityNotFoundException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.test.context.ActiveProfiles;
+import rencanakan.id.talentpool.dto.FilterTalentDTO;
+import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
+import rencanakan.id.talentpool.model.User;
+import rencanakan.id.talentpool.repository.UserRepository;
+import rencanakan.id.talentpool.service.UserService;
+import rencanakan.id.talentpool.service.UserServiceImpl;
+
+import java.util.List;
+
+import static org.junit.Assert.*;
path: src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Inconsistent JUnit version usage**

The test is using JUnit 5 for test annotations (`org.junit.jupiter`) but imports assertions from JUnit 4 (`org.junit.Assert`). This creates an unnecessary dependency on two JUnit versions.

Replace with JUnit 5 assertions:

```diff
- import static org.junit.Assert.*;
+ import static org.junit.jupiter.api.Assertions.*;
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
import static org.junit.jupiter.api.Assertions.*;
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-26T12:25:10Z
author_association: NONE
diff_hunk: @@ -0,0 +1,118 @@
+package rencanakan.id.talentpool.integration;
+
+import jakarta.persistence.EntityNotFoundException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.test.context.ActiveProfiles;
+import rencanakan.id.talentpool.dto.FilterTalentDTO;
+import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
+import rencanakan.id.talentpool.model.User;
+import rencanakan.id.talentpool.repository.UserRepository;
+import rencanakan.id.talentpool.service.UserService;
+import rencanakan.id.talentpool.service.UserServiceImpl;
+
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+@DataJpaTest
+@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
+@ActiveProfiles("test")
+class UserServiceIntegrationTest {
+
+    @Autowired
+    private UserRepository userRepository;
+    private UserService userService;
+    private  Pageable page;
+
+    @BeforeEach
+    void setup() {
+        userService = new UserServiceImpl(userRepository);
+        User user = User.builder()
+                .firstName("John")
+                .lastName("Doe")
+                .email("john.doe@example.com")
+                .password("SecurePass123!")
+                .phoneNumber("081234567890")
+                .nik("1234567890123456")
+                .preferredLocations(List.of("Jakarta", "Bandung","NY"))
+                .skill("Java")
+                .price(75)
+                .aboutMe("Full-stack developer with 5+ years experience")
+                .build();
+        userRepository.save(user);
+
+        page = PageRequest.of(0, 1);
+    }
+
+
+    @Test
+    void testFilter_SuccessfulMatch() {
+        FilterTalentDTO filter = FilterTalentDTO.builder().name("john").preferredLocations( List.of("NY")).skills(List.of("Java")).priceRange(List.of(50.0, 100.0)).build();
+
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty());
+        assertEquals("John", result.getUsers().get(0).getFirstName()); // Case-insensitive [[7]]
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+
+    @Test
+    void testFilter_LocationMismatch() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, List.of("CA"), null, null);
+        assertThrows(EntityNotFoundException.class, () -> userService.filter(filter,page));
+    }
+
+    // Edge Test: Empty price range (ignored) [[6]]
+    @Test
+    void testFilter_EmptyPriceRange() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of());
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty()); // Price filter skipped
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
path: src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Use JUnit's assertEquals with correct parameter order**

The assertions have parameters in the wrong order (expected should come first).

```diff
- assertEquals(result.getPage(),0);
- assertEquals(result.getSize(), 1);
- assertEquals(result.getTotalPages(), 1);
+ assertEquals(0, result.getPage(), "Page number should be 0");
+ assertEquals(1, result.getSize(), "Page size should be 1");
+ assertEquals(1, result.getTotalPages(), "Total pages should be 1");
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
        assertEquals(0, result.getPage(), "Page number should be 0");
        assertEquals(1, result.getSize(), "Page size should be 1");
        assertEquals(1, result.getTotalPages(), "Total pages should be 1");
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-26T12:25:10Z
author_association: NONE
diff_hunk: @@ -0,0 +1,118 @@
+package rencanakan.id.talentpool.integration;
+
+import jakarta.persistence.EntityNotFoundException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.test.context.ActiveProfiles;
+import rencanakan.id.talentpool.dto.FilterTalentDTO;
+import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
+import rencanakan.id.talentpool.model.User;
+import rencanakan.id.talentpool.repository.UserRepository;
+import rencanakan.id.talentpool.service.UserService;
+import rencanakan.id.talentpool.service.UserServiceImpl;
+
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+@DataJpaTest
+@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
+@ActiveProfiles("test")
+class UserServiceIntegrationTest {
+
+    @Autowired
+    private UserRepository userRepository;
+    private UserService userService;
+    private  Pageable page;
+
+    @BeforeEach
+    void setup() {
+        userService = new UserServiceImpl(userRepository);
+        User user = User.builder()
+                .firstName("John")
+                .lastName("Doe")
+                .email("john.doe@example.com")
+                .password("SecurePass123!")
+                .phoneNumber("081234567890")
+                .nik("1234567890123456")
+                .preferredLocations(List.of("Jakarta", "Bandung","NY"))
+                .skill("Java")
+                .price(75)
+                .aboutMe("Full-stack developer with 5+ years experience")
+                .build();
+        userRepository.save(user);
+
+        page = PageRequest.of(0, 1);
+    }
+
+
+    @Test
+    void testFilter_SuccessfulMatch() {
+        FilterTalentDTO filter = FilterTalentDTO.builder().name("john").preferredLocations( List.of("NY")).skills(List.of("Java")).priceRange(List.of(50.0, 100.0)).build();
+
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty());
+        assertEquals("John", result.getUsers().get(0).getFirstName()); // Case-insensitive [[7]]
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
path: src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Use JUnit's assertEquals with correct parameter order**

The assertions use `assertEquals` with parameters in the wrong order (expected should come first). Also, the direct use of equals on line 63-65 should be replaced with proper assertEquals calls.

```diff
- assertEquals("John", result.getUsers().get(0).getFirstName()); // Case-insensitive [[7]]
- assertEquals(result.getPage(),0);
- assertEquals(result.getSize(), 1);
- assertEquals(result.getTotalPages(), 1);
+ assertEquals("John", result.getUsers().get(0).getFirstName(), "First name should match"); // Case-insensitive
+ assertEquals(0, result.getPage(), "Page number should be 0");
+ assertEquals(1, result.getSize(), "Page size should be 1");
+ assertEquals(1, result.getTotalPages(), "Total pages should be 1");
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-26T12:25:11Z
author_association: NONE
diff_hunk: @@ -0,0 +1,118 @@
+package rencanakan.id.talentpool.integration;
+
+import jakarta.persistence.EntityNotFoundException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.test.context.ActiveProfiles;
+import rencanakan.id.talentpool.dto.FilterTalentDTO;
+import rencanakan.id.talentpool.dto.UserResponseDTO;
+import rencanakan.id.talentpool.dto.UserResponseWithPagingDTO;
+import rencanakan.id.talentpool.model.User;
+import rencanakan.id.talentpool.repository.UserRepository;
+import rencanakan.id.talentpool.service.UserService;
+import rencanakan.id.talentpool.service.UserServiceImpl;
+
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+@DataJpaTest
+@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
+@ActiveProfiles("test")
+class UserServiceIntegrationTest {
+
+    @Autowired
+    private UserRepository userRepository;
+    private UserService userService;
+    private  Pageable page;
+
+    @BeforeEach
+    void setup() {
+        userService = new UserServiceImpl(userRepository);
+        User user = User.builder()
+                .firstName("John")
+                .lastName("Doe")
+                .email("john.doe@example.com")
+                .password("SecurePass123!")
+                .phoneNumber("081234567890")
+                .nik("1234567890123456")
+                .preferredLocations(List.of("Jakarta", "Bandung","NY"))
+                .skill("Java")
+                .price(75)
+                .aboutMe("Full-stack developer with 5+ years experience")
+                .build();
+        userRepository.save(user);
+
+        page = PageRequest.of(0, 1);
+    }
+
+
+    @Test
+    void testFilter_SuccessfulMatch() {
+        FilterTalentDTO filter = FilterTalentDTO.builder().name("john").preferredLocations( List.of("NY")).skills(List.of("Java")).priceRange(List.of(50.0, 100.0)).build();
+
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty());
+        assertEquals("John", result.getUsers().get(0).getFirstName()); // Case-insensitive [[7]]
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+
+    @Test
+    void testFilter_LocationMismatch() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, List.of("CA"), null, null);
+        assertThrows(EntityNotFoundException.class, () -> userService.filter(filter,page));
+    }
+
+    // Edge Test: Empty price range (ignored) [[6]]
+    @Test
+    void testFilter_EmptyPriceRange() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of());
+        UserResponseWithPagingDTO result = userService.filter(filter,page);
+        assertFalse(result.getUsers().isEmpty()); // Price filter skipped
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+    // Edge Test: Exact price boundary [[4]]
+    @Test
+    void testFilter_ExactPriceBoundary() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, null, List.of(75.0, 75.0));
+        UserResponseWithPagingDTO result = userService.filter(filter, page);
+        assertFalse(result.getUsers().isEmpty()); // Exact price match
+        assertEquals(result.getPage(),0);
+        assertEquals(result.getSize(), 1);
+        assertEquals(result.getTotalPages(), 1);
+    }
+
+    // Negative Test: Non-existent skill [[4]]
+    @Test
+    void testFilter_SkillMismatch() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, null, List.of("Python"), null);
+        assertThrows(EntityNotFoundException.class, () -> userService.filter(filter,page));
+    }
+    @Test
+    void testBlank() {
+        FilterTalentDTO filter = new FilterTalentDTO(null, List.of(), List.of(), null);
+        UserResponseWithPagingDTO result = userService.filter(filter, page);
+        assertFalse(result.getUsers().isEmpty());
+        assertEquals(result.getTotalPages(), 1);
+    }
path: src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Improve test method naming and logic consistency**

The test method name "testBlank" is not descriptive enough. Also, the FilterTalentDTO construction pattern differs from other tests.

```diff
- void testBlank() {
+ void testFilter_BlankCollections() {
-     FilterTalentDTO filter = new FilterTalentDTO(null, List.of(), List.of(), null);
+     FilterTalentDTO filter = FilterTalentDTO.builder()
+         .preferredLocations(List.of())
+         .skills(List.of())
+         .build();
      UserResponseWithPagingDTO result = userService.filter(filter, page);
      assertFalse(result.getUsers().isEmpty());
-     assertEquals(result.getTotalPages(), 1);
+     assertEquals(1, result.getTotalPages(), "Total pages should be 1");
+     assertEquals(0, result.getPage(), "Page number should be 0");
+     assertEquals(1, result.getSize(), "Page size should be 1");
}
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
    void testFilter_BlankCollections() {
        FilterTalentDTO filter = FilterTalentDTO.builder()
            .preferredLocations(List.of())
            .skills(List.of())
            .build();
        UserResponseWithPagingDTO result = userService.filter(filter, page);
        assertFalse(result.getUsers().isEmpty());
        assertEquals(1, result.getTotalPages(), "Total pages should be 1");
        assertEquals(0, result.getPage(), "Page number should be 0");
        assertEquals(1, result.getSize(), "Page size should be 1");
    }
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-26T12:25:11Z
author_association: NONE
diff_hunk: @@ -104,17 +110,41 @@ public List<UserResponseDTO> filter(FilterTalentDTO filter) {
                 predicates.add(builder.or(firstNamePredicate, lastNamePredicate));
             }
 
+            if (Objects.nonNull(filter.getPreferredLocations()) && !filter.getPreferredLocations().isEmpty()) {
+
+                Predicate locationPredicate = root.get("currentLocation").in(filter.getPreferredLocations());
+
+                predicates.add(locationPredicate);
+            }
+
+            if (Objects.nonNull(filter.getSkills()) && !filter.getSkills().isEmpty()) {
+                Predicate skillsPredicate = root.get("skill").in(filter.getSkills());
+                predicates.add(skillsPredicate);
+            }
+
+            if (Objects.nonNull(filter.getPriceRange()) && filter.getPriceRange().size() == 2) {
+                Double minPrice = filter.getPriceRange().get(0);
+                Double maxPrice = filter.getPriceRange().get(1);
+
+                Predicate pricePredicate = builder.between(root.get("price"), minPrice, maxPrice);
+
+                predicates.add(pricePredicate);
+            }
path: src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add additional validation for price range**

The current implementation assumes that `getPriceRange()` will always return a list with exactly 2 elements. Consider adding more robust validation to handle cases where the list might be malformed.


```diff
 if (Objects.nonNull(filter.getPriceRange()) && filter.getPriceRange().size() == 2) {
     Double minPrice = filter.getPriceRange().get(0);
     Double maxPrice = filter.getPriceRange().get(1);
+    
+    // Add additional validation to ensure minPrice <= maxPrice
+    if (minPrice > maxPrice) {
+        Double temp = minPrice;
+        minPrice = maxPrice;
+        maxPrice = temp;
+    }

     Predicate pricePredicate = builder.between(root.get("price"), minPrice, maxPrice);

     predicates.add(pricePredicate);
 }
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-28T12:54:55Z
author_association: NONE
diff_hunk: @@ -104,17 +110,41 @@ public List<UserResponseDTO> filter(FilterTalentDTO filter) {
                 predicates.add(builder.or(firstNamePredicate, lastNamePredicate));
             }
 
+            if (Objects.nonNull(filter.getPreferredLocations()) && !filter.getPreferredLocations().isEmpty()) {
+
+                Predicate locationPredicate = root.get("currentLocation").in(filter.getPreferredLocations());
+
+                predicates.add(locationPredicate);
+            }
path: src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Check preferred locations filtering logic**

There seems to be a discrepancy in the filtering logic. The method checks if `filter.getPreferredLocations()` exists but then applies the filter on the user's `currentLocation`, not their `preferredLocations`. This may not match the intended behavior.


```diff
 if (Objects.nonNull(filter.getPreferredLocations()) && !filter.getPreferredLocations().isEmpty()) {

-    Predicate locationPredicate = root.get("currentLocation").in(filter.getPreferredLocations());
+    Predicate locationPredicate = root.get("preferredLocations").in(filter.getPreferredLocations());

     predicates.add(locationPredicate);
 }
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
            if (Objects.nonNull(filter.getPreferredLocations()) && !filter.getPreferredLocations().isEmpty()) {

                Predicate locationPredicate = root.get("preferredLocations").in(filter.getPreferredLocations());

                predicates.add(locationPredicate);
            }
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-28T12:54:55Z
author_association: NONE

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-04-26T12:22:17Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

This change enhances the user talent filtering functionality by introducing advanced filtering options and pagination support. The `UserController` and `UserService` now accept additional filter parameters for skills, preferred locations, and price range, along with pagination controls (`page` and `size`). The filtering logic in the service is updated to apply these new criteria and return results in a paginated format using a new `UserResponseWithPagingDTO`. Both the API response and DTOs are updated to include pagination metadata. Corresponding unit and integration tests are added and updated to validate the new filtering and pagination behavior.

## Changes

| File(s)                                                                                  | Change Summary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `src/main/java/rencanakan/id/talentpool/controller/UserController.java`                 | Enhanced `getAllTalent` endpoint to support filtering by skills, preferred locations, price range, and pagination; updated method signature and response to include pagination metadata.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `src/main/java/rencanakan/id/talentpool/dto/FilterTalentDTO.java`                       | Added new fields for `skills`, `preferredLocations`, and `priceRange`; included Lombok annotations for constructors and builder pattern.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `src/main/java/rencanakan/id/talentpool/dto/UserResponseWithPagingDTO.java`             | Introduced new DTO to encapsulate paginated user responses, including a list of users and pagination metadata (page, size, totalPages), with Lombok annotations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `src/main/java/rencanakan/id/talentpool/dto/WebResponse.java`                           | Added pagination metadata fields (`page`, `size`, `totalPages`) to the generic web response wrapper.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `src/main/java/rencanakan/id/talentpool/service/UserService.java`                       | Updated `filter` method signature to accept a `Pageable` parameter and return a `UserResponseWithPagingDTO` for paginated results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `src/main/java/rencanakan/id/talentpool/service/UserServiceImpl.java`                   | Modified filtering logic to support new filter criteria and pagination; updated method to return paginated DTO with metadata.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `src/test/java/rencanakan/id/talentpool/integration/UserServiceIntegrationTest.java`    | Added comprehensive integration tests for filtering and pagination, covering various scenarios and edge cases.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `src/test/java/rencanakan/id/talentpool/unit/controller/UserControllerTest.java`        | Updated tests to mock and verify new service method signature and paginated DTO responses.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `src/test/java/rencanakan/id/talentpool/unit/service/UserServiceTest.java`              | Enhanced and added tests for filtering with pagination and new filter criteria; introduced helper methods and updated assertions for paginated results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Client
    participant UserController
    participant UserService
    participant UserRepository

    Client->>UserController: GET /talent?name=&skills=&preferredLocations=&priceRange=&page=&size=
    UserController->>UserService: filter(FilterTalentDTO, Pageable)
    UserService->>UserRepository: findAll(specification, pageable)
    UserRepository-->>UserService: Page<User>
    UserService-->>UserController: UserResponseWithPagingDTO
    UserController-->>Client: WebResponse<UserResponseWithPagingDTO> (with pagination metadata)
```

## Possibly related PRs

- [Rencanakan-id/rencanakan-talent_pool-backend#39](https://github.com/Rencanakan-id/rencanakan-talent_pool-backend/pull/39): Implements the initial name-only filtering endpoint and service method without pagination or additional filters; the current PR builds upon and expands this feature with advanced filtering and pagination.

## Poem

> In fields of code, the talents grow,  
> With filters wide and pages flow.  
> Skills and places, price in range,  
> Now searching's easy to arrange!  
> Results arrive in tidy sets,  
> With page and size—no need for sweats.  
> 🐇 Hopping forward, features bloom—  
> Pagination brings more room!

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgE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
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=Rencanakan-id/rencanakan-talent_pool-backend&utm_content=41):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE
user: login: muhkemallgp
created_at: 2025-04-26T13:45:53Z
body: looks very good mi, testing dan componennt jga udh sesuai keren banget.  Paling kalau mau consider review rabbit yg di implement boleh banget si
author_association: COLLABORATOR
user: login: sonarqubecloud[bot]
created_at: 2025-04-28T12:54:51Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=Rencanakan-id_rencanakan-talent_pool-backend&pullRequest=41) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [13 New issues](https://sonarcloud.io/project/issues?id=Rencanakan-id_rencanakan-talent_pool-backend&pullRequest=41&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=Rencanakan-id_rencanakan-talent_pool-backend&pullRequest=41&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=Rencanakan-id_rencanakan-talent_pool-backend&pullRequest=41&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [94.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=Rencanakan-id_rencanakan-talent_pool-backend&pullRequest=41&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=Rencanakan-id_rencanakan-talent_pool-backend&pullRequest=41&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=Rencanakan-id_rencanakan-talent_pool-backend&pullRequest=41)


author_association: NONE
user: login: raviehasan
created_at: 2025-04-28T13:01:25Z
body: overall looks greatt, strukturnya juga udah bagus, oiya tapi setau method assertEquals tu urutan passing parameternya assertEquals(expected, actual), kayaknya kalo kebalik error messagenya bisa jadi misleading (tapi harusnya ga pengaruh ke muncul/ngganya error sihh) *cmiiw
author_association: COLLABORATOR