Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add total users count to the search results #113

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
@AllArgsConstructor
public class AllUsersResponseDetails {
private List<UserResponse> users;
private int total;
}
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ void testGenerateEmbeddedLinkForSuccess() {
@Test
void testSearchAllForSuccess() {
UserResponse userResponse = mock(UserResponse.class);
AllUsersResponseDetails allUsersResponse = new AllUsersResponseDetails(Arrays.asList(userResponse));
AllUsersResponseDetails allUsersResponse = new AllUsersResponseDetails(Arrays.asList(userResponse), 0);
UserSearchRequest userSearchRequest = UserSearchRequest.builder().limit(6).page(1).build();
ApiProxy apiProxy = mock(ApiProxy.class);
doReturn(allUsersResponse).when(apiProxy).post(any(), any(), any());
Expand Down Expand Up @@ -853,6 +853,7 @@ void testFunctionalFullCycle() {
}
}
assertTrue(found);
assertTrue(searchResponse.getTotal() > 0);
// Delete
userService.delete(newLoginId);
}
Expand Down Expand Up @@ -886,6 +887,7 @@ void testFunctionalTestUsers() {
}
}
assertTrue(found);
assertTrue(searchResponse.getTotal() > 0);
searchResponse = userService
.searchAll(UserSearchRequest.builder().testUsersOnly(true).emails(Arrays.asList(user.getEmail())).build());
found = false;
Expand All @@ -896,6 +898,7 @@ void testFunctionalTestUsers() {
}
}
assertTrue(found);
assertTrue(searchResponse.getTotal() > 0);
// Delete
userService.delete(loginId);
}
Expand Down