Skip to content

Commit

Permalink
issues
Browse files Browse the repository at this point in the history
  • Loading branch information
holotsvan committed Nov 26, 2024
1 parent 40b1b3a commit 66f29e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ void setUp() {
@SneakyThrows
void acceptHabitInvitationShouldReturn200() {
Long invitationId = 1L;
UserVO userVO = new UserVO();

when(userService.findByEmail(principal.getName())).thenReturn(userVO);

Expand All @@ -86,7 +85,6 @@ void acceptHabitInvitationShouldReturn200() {
@SneakyThrows
void rejectHabitInvitationShouldReturn200() {
Long invitationId = 2L;
UserVO userVO = new UserVO();
when(userService.findByEmail(principal.getName())).thenReturn(userVO);

mockMvc.perform(delete("/habit/invite/{invitationId}/reject", invitationId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ void testRejectHabitInvitation_NotPendingStatusInvitation() {

@Test
void testGetAllUserHabitInvitationRequestsNoRequests() {
Long userId = 1L;
Pageable pageable = PageRequest.of(0, 10);
Page<HabitInvitation> invitations = new PageImpl<>(Arrays.asList(), pageable, 0);

Expand All @@ -364,8 +363,8 @@ void testGetAllUserHabitInvitationRequestsNoRequests() {
PageableAdvancedDto<HabitInvitationDto> result =
habitInvitationService.getAllUserHabitInvitationRequests(userId, "en", pageable);

verify(habitInvitationRepo, times(1)).findByInviteeIdAndStatusIn(eq(userId),
eq(Collections.singleton(HabitInvitationStatus.PENDING)), eq(pageable));
verify(habitInvitationRepo, times(1)).findByInviteeIdAndStatusIn(userId,
Collections.singleton(HabitInvitationStatus.PENDING), pageable);
assertNotNull(result);
assertEquals(0, result.getPage().size());
}
Expand Down Expand Up @@ -408,8 +407,8 @@ void testGetAllUserHabitInvitationRequests() {
PageableAdvancedDto<HabitInvitationDto> result =
habitInvitationService.getAllUserHabitInvitationRequests(userId, "en", pageable);

verify(habitInvitationRepo, times(1)).findByInviteeIdAndStatusIn(eq(userId),
eq(Collections.singleton(HabitInvitationStatus.PENDING)), eq(pageable));
verify(habitInvitationRepo, times(1)).findByInviteeIdAndStatusIn(userId,
Collections.singleton(HabitInvitationStatus.PENDING), pageable);

assertNotNull(result);
assertEquals(1, result.getPage().size());
Expand Down

0 comments on commit 66f29e3

Please sign in to comment.